The view pg_tables
provides access to useful information about each table in the database.
pg_tables
ColumnsColumn Type
Description
schemaname
name
(references .nspname
)
Name of schema containing table
tablename
name
(references .relname
)
Name of table
tableowner
name
(references .rolname
)
Name of table's owner
tablespace
name
(references .spcname
)
Name of tablespace containing table (null if default for database)
hasindexes
bool
(references .relhasindex
)
True if table has (or recently had) any indexes
hasrules
bool
(references .relhasrules
)
True if table has (or once had) rules
hastriggers
bool
(references .relhastriggers
)
True if table has (or once had) triggers
rowsecurity
bool
(references .relrowsecurity
)
True if row security is enabled on the table