MSNCodeSNIPPETS← msncode.dev
snippets/postgres

Kill a Running Query

Cancel a long-running PostgreSQL query by PID

postgressqlkillpid
SQL
SELECT pg_cancel_backend(<pid>);

More postgres snippets

Create User and Database

Create a new PostgreSQL user and database

Describe Table Structure

Show columns, types, and constraints of a table

Export Table to CSV

Export a PostgreSQL table to a CSV file

Find Duplicate Rows

Find rows with duplicate values in a column