Postgres - Getting started

Show all tables

select table_schema, table_name
from information_schema.tables
order by 1, 2;

Describe a table

\d+ tablename

Which by the client is converted to:

select column_name, data_type, character_maximum_length
from INFORMATION_SCHEMA.COLUMNS where table_name = '<name of table>';

To get out of Postgres

\q