Terminal commands:

Launch PostgreSQL terminal – psql

Copy table from one db to another – pg_dump -t table_name copyfrom_db_name | psql copyto_db_name

 

PSQL commands:

List databases – \d

List tables in current database – \dt

List table structure – \d table_name

List table contents – TABLE table_name;

Connect to a different database – \c database_name