Summary
The view pg_tables provides access to useful information about each table in the database.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_tables system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
schemanamenamereferencespg_namespace.nspname
Name of schema containing tabletablenamenamereferencespg_class.relname
Name of tabletableownernamereferencespg_authid.rolname
Name of table’s ownertablespacenamereferencespg_tablespace.spcname
Name of tablespace containing table (null if default for database)hasindexesboolreferencespg_class.relhasindex
True if table has (or recently had) any indexeshasrulesboolreferencespg_class.relhasrules
True if table has (or once had) ruleshastriggersboolreferencespg_class.relhastriggers
True if table has (or once had) triggersrowsecurityboolreferencespg_class.relrowsecurity
True if row security is enabled on the table
Related catalogs
This object references the following other system catalogs:
schemaname→pg_namespacetablename→pg_classtableowner→pg_authidtablespace→pg_tablespace
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_tables.