Postgres psql Commands

  • list databases: \l
  • connect to database / switch database: \c DB_NAME
  • list tables: \dt
  • foreign servers: \des+
  • foreign tables: \det+
  • sequences: \ds+
  • trigger functions: \dft
  • triggers: \dS <tablename>
  • (trigger) function source: \df+ <functionname>
  • more commands: \?
  • SQL help: \h

+ means more details, \d describe I guess, usually database need to be selected before a command to see data. Command won't error out if database is not selected.