PostgreSQL CLI (psql) & Admin Commands Matrix
Production PostgreSQL administration reference: psql shortcuts (\l, \dt+), database sizes, terminating stuck queries, active locks, vacuum analyze, and pg_dump backup with 1-click copy.
psql Meta-Commands (10 commands)
psql -U <user> -d <database> -h <host> -p 5432
Connects to a PostgreSQL database instance via terminal CLI.
\l
Lists all databases on the PostgreSQL cluster along with owner and encoding.
\c <database_name>
Switches connection context to a different database.
\dt
Lists all tables in the current schema.
\d <table_name>
Describes table schema: columns, data types, nullability, defaults, and indexes.