psql -d appdb -c '\dn'

Category: Databases & SQL

psql -d appdb -c '\dn'

List schemas in the current database

Lists schemas from pg_namespace, usually public plus system schemas like pg_catalog and information_schema. Schema access requires USAGE privilege, so inspect \dn when grants seem to have no effect.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.