To create a database;
createdb [db-name]
To get a psql prompt;
psql [db-name]
To export table data;
pg_dump --data-only --table=table-name db-name > file-name
Following commands can be executed at psql prompt.
list all databases in postgres; \l
list all tables in a database; \d
execute a sql script; \i [sql-script]
Comments