Create a database.
$ createdb [database]
Drop a database.
$ dropdb [database]
Dump a database.
$ pg_dump [database] > [database].sql
Load a database dump.
$ pg_restore -d [database] [database].sql
List all tables.
\dt
Connect to a database.
\c [database]
Delete rows in a table (leave the WHERE
clause off to delete all rows).
DELETE FROM [TABLE] WHERE ...;
This is a Solutions Log post.