MSNCodeSNIPPETS← msncode.dev
snippets/postgres

Create User and Database

Create a new PostgreSQL user and database

postgressqlusercreate
SQL
CREATE USER myuser WITH PASSWORD 'password';
CREATE DATABASE mydb OWNER myuser;

More postgres snippets

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

Kill a Running Query

Cancel a long-running PostgreSQL query by PID