Selecting a database in PostgresSQL
- open psql
psql -U pg
- list databases
\list
or\l
- select a database
\connect DBNAME
or\c DBNAME
- list all database tables
\dt
using thesearch_path
- list all database tables regardless of
search_path
by\dt *.
- describe the table to see schema
\d TABLE_NAME
- more info with
\d+
- list all database tables regardless of
- show data
select * from TABLE