The view pg_tables provides access to useful information about each table in the database.
pg_tables
Name
Type
References
Description
schemaname
name
pg_namespacearrow-up-right.nspname
pg_namespace
Name of schema containing table
tablename
pg_classarrow-up-right.relname
pg_class
Name of table
tableowner
pg_authidarrow-up-right.rolname
pg_authid
Name of table's owner
tablespace
pg_tablespacearrow-up-right.spcname
pg_tablespace
Name of tablespace containing table (null if default for database)
hasindexes
boolean
pg_classarrow-up-right.relhasindex
True if table has (or recently had) any indexes
hasrules
pg_classarrow-up-right.relhasrules
True if table has (or once had) rules
hastriggers
pg_classarrow-up-right.relhastriggers
True if table has (or once had) triggers
rowsecurity
pg_classarrow-up-right.relrowsecurity
True if row security is enabled on the table
Last updated 4 years ago
Was this helpful?