PG_TABLES
PG_TABLES is used to query useful information about each table in the database.
Name |
Type |
Reference |
Description |
---|---|---|---|
schemaname |
name |
nspname in PG_NAMESPACE |
Name of the schema that contains a table. |
tablename |
name |
relname in PG_CLASS |
Table name. |
tableowner |
name |
pg_get_userbyid(relowner in PG_CLASS) |
Table owner. |
tablespace |
name |
spcname in PG_TABLESPACE |
Tablespace that contains the table (default value: NULL). |
hasindexes |
Boolean |
relhasindex in PG_CLASS |
Specifies whether the table has (or recently had) an index. If it does, the value is TRUE. Otherwise, the value is FALSE. |
hasrules |
Boolean |
relhasruls in PG_CLASS |
Specifies whether the table has rules. If it does, the value is TRUE. Otherwise, the value is FALSE. |
hastriggers |
Boolean |
RELHASTRIGGERS in PG_CLASS |
Specifies whether the table has triggers. If it does, the value is TRUE. Otherwise, the value is FALSE. |
tablecreator |
name |
pg_get_userbyid(creator in PG_OBJECT) |
Table owner. |
created |
timestamp with time zone |
ctime in PG_OBJECT |
Time when the table is created. |
last_ddl_time |
timestamp with time zone |
mtime in PG_OBJECT |
Time when the last DDL operation is performed on the table. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.