PostgreSQL commands cheat sheet
Create a new user
1 | CREATE USER username WITH PASSWORD 'password'; |
Create a new database belong to specified user and grant all privileges to the user
1 | CREATE DATABASE dbname OWNER username; |
Check current tables in the database
1 | \dt |
Delete everything in the database
1 | DROP SCHEMA public CASCADE; |
Migragte data from one database to another
1 | # psql dump data from source database to a sql file |