pg_tables
pg_tables
is a system catalogue view listing the available tables in the current database.
pg_tables
was added in PostgreSQL 6.4 (commit f93b6974).
Definition by PostgreSQL version
pg_tables (PostgreSQL 14)
View "pg_catalog.pg_tables" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- schemaname | name | | | tablename | name | | | tableowner | name | | | tablespace | name | | | hasindexes | boolean | | | hasrules | boolean | | | hastriggers | boolean | | | rowsecurity | boolean | | |
Documentation: pg_tables
pg_tables (PostgreSQL 13)
View "pg_catalog.pg_tables" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- schemaname | name | | | tablename | name | | | tableowner | name | | | tablespace | name | | | hasindexes | boolean | | | hasrules | boolean | | | hastriggers | boolean | | | rowsecurity | boolean | | |
Documentation: pg_tables
pg_tables (PostgreSQL 12)
View "pg_catalog.pg_tables" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- schemaname | name | | | tablename | name | | | tableowner | name | | | tablespace | name | | | hasindexes | boolean | | | hasrules | boolean | | | hastriggers | boolean | | | rowsecurity | boolean | | |
Documentation: pg_tables
pg_tables (PostgreSQL 11)
View "pg_catalog.pg_tables" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- schemaname | name | | | tablename | name | | | tableowner | name | | | tablespace | name | | | hasindexes | boolean | | | hasrules | boolean | | | hastriggers | boolean | | | rowsecurity | boolean | | |
Documentation: pg_tables
pg_tables (PostgreSQL 10)
View "pg_catalog.pg_tables" Column | Type | Collation | Nullable | Default -------------+---------+-----------+----------+--------- schemaname | name | | | tablename | name | | | tableowner | name | | | tablespace | name | | | hasindexes | boolean | | | hasrules | boolean | | | hastriggers | boolean | | | rowsecurity | boolean | | |
Documentation: pg_tables
pg_tables (PostgreSQL 9.6)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean | rowsecurity | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.5)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean | rowsecurity | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.4)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.3)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.2)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.1)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 9.0)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean |
Documentation: pg_tables
pg_tables (PostgreSQL 8.4)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean | View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, t.spcname AS tablespace, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, c.relhastriggers AS hastriggers FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace WHERE c.relkind = 'r'::"char";
Documentation: pg_tables
pg_tables (PostgreSQL 8.3)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean | View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, t.spcname AS tablespace, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, c.reltriggers > 0 AS hastriggers FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace WHERE c.relkind = 'r'::"char";
Documentation: pg_tables
pg_tables (PostgreSQL 8.2)
View "pg_catalog.pg_tables" Column | Type | Modifiers -------------+---------+----------- schemaname | name | tablename | name | tableowner | name | tablespace | name | hasindexes | boolean | hasrules | boolean | hastriggers | boolean | View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, t.spcname AS "tablespace", c.relhasindex AS hasindexes, c.relhasrules AS hasrules, c.reltriggers > 0 AS hastriggers FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace WHERE c.relkind = 'r'::"char";
Documentation: pg_tables
Change history
- PostgreSQL 9.5
- column
hasrowsecurity
added (commit 491c029d)
- column
- PostgreSQL 8.0
- column
tablespace
added (commit 4690cc9c)
- column
- PostgreSQL 7.3
- column
schemaname
added (commit 3b78826b)
- column
- PostgreSQL 6.4
- added (commit f93b6974)
References
- PostgreSQL documentation: pg_tables