Useful Postgres Commands
March 9, 2019 ยท View on GitHub
Connecting to Postgres
$ psql postgres
List tables in database
postgres=# \d
List all databases
postgres=# \l
Connect to another database
postgres=# \c dbname
Exit postgres shell
postgres=# \q
Create database
postgres=# CREATE DATABASE databasename;
Drop database
postgres=# DROP DATABASE name;
Find more useful postgres commands here