postgreSQL - RayGutt/PersonalWiki GitHub Wiki
get info on the current connection:
\conninfo
list databases:
\list
switch database:
\connect dbname
# or
\c dbname
show tables in the current database:
\dt
describe a table:
\d table_name
# or
\d+ table_name
# or, for a simpler output
SELECT
COLUMN_NAME
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'table_name';