psql -d appdb -c '\dt'

Category: Databases & SQL

psql -d appdb -c '\dt'

List tables in the current schema

\dt is a psql meta-command, not SQL: it queries the catalog and lists user tables in the current schema. Add a pattern like \dt orders* to filter. Related: \d+ users for full structure, \di for indexes.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.