{"Entry":{"collection":"catalog","key":"pg_class","name":"pg_class","aliases":[],"metadata":{"changed_in":["8.0","8.1","8.2","8.4","9.0","9.1","9.2","9.3","9.4","9.5","10","11","12","18"],"changes":[{"added":["reltablespace"],"attributes":[],"description_changed":true,"descriptions":[{"from":"Access privileges; see the descriptions of GRANT and REVOKE for details.","name":"relacl","to":"Access privileges; see GRANT and REVOKE for details."},{"from":"Table has rules; see pg_rewrite catalog","name":"relhasrules","to":"True if table has rules; see pg_rewrite catalog."},{"from":"At least one table inherits from this one","name":"relhassubclass","to":"True if table has (or once had) any inheritance children."},{"from":"Size of the on-disk representation of this table in pages (size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and CREATE INDEX.","name":"relpages","to":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX."},{"from":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and CREATE INDEX.","name":"reltuples","to":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX."},{"from":"The OID of the data type that corresponds to this table, if any (zero for indexes, which have no pg_type entry)","name":"reltype","to":"The OID of the data type that corresponds to this table's row type, if any (zero for indexes, which have no pg_type entry)"}],"from":"7.4","listing":[],"order":false,"removed":[],"status":"changed","to":"8.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"8.0","listing":[],"order":false,"removed":[],"status":"changed","to":"8.1","types":[{"from":"int4","name":"relowner","to":"oid"}],"unlisted":[]},{"added":["relfrozenxid","reloptions"],"attributes":[],"description_changed":true,"descriptions":[{"from":"Access privileges; see GRANT and REVOKE for details.","name":"relacl","to":"Access privileges; see GRANT and REVOKE for details"},{"from":"unused (not the number of foreign keys on the table)","name":"relfkeys","to":"Unused (not the number of foreign keys on the table)"},{"from":"True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX, but not cleared immediately by DROP INDEX. VACUUM clears relhasindex if it finds the table has no indexes.","name":"relhasindex","to":"True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX, but not cleared immediately by DROP INDEX. VACUUM clears relhasindex if it finds the table has no indexes"},{"from":"True if we generate an OID for each row of the relation.","name":"relhasoids","to":"True if we generate an OID for each row of the relation"},{"from":"True if the table has (or once had) a primary key.","name":"relhaspkey","to":"True if the table has (or once had) a primary key"},{"from":"True if table has rules; see pg_rewrite catalog.","name":"relhasrules","to":"True if table has rules; see pg_rewrite catalog"},{"from":"True if table has (or once had) any inheritance children.","name":"relhassubclass","to":"True if table has (or once had) any inheritance children"},{"from":"True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared.","name":"relisshared","to":"True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared"},{"from":"r = ordinary table, i = index, S = sequence, v = view, c = composite type, s = special, t = TOAST table","name":"relkind","to":"r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table"},{"from":"Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum.","name":"relnatts","to":"Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum"},{"from":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"relpages","to":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX"},{"from":"unused","name":"relrefs","to":"Unused"},{"from":"For a TOAST table, the OID of its index. 0 if not a TOAST table.","name":"reltoastidxid","to":"For a TOAST table, the OID of its index. 0 if not a TOAST table"},{"from":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes \"out of line\" in a secondary table.","name":"reltoastrelid","to":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes \"out of line\" in a secondary table"},{"from":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"reltuples","to":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX"},{"from":"unused (not the number of unique keys)","name":"relukeys","to":"Unused (not the number of unique keys)"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"changed","to":"8.2","types":[],"unlisted":[]},{"added":["relistemp","relhastriggers"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Number of check constraints on the table; see pg_constraint catalog","name":"relchecks","to":"Number of CHECK constraints on the table; see pg_constraint catalog"},{"from":"True if table has rules; see pg_rewrite catalog","name":"relhasrules","to":"True if table has (or once had) rules; see pg_rewrite catalog"}],"from":"8.3","listing":[],"order":false,"removed":["reltriggers","relukeys","relfkeys","relrefs"],"status":"changed","to":"8.4","types":[],"unlisted":[]},{"added":["reloftype","relhasexclusion"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Name of the on-disk file of this relation; 0 if none","name":"relfilenode","to":"Name of the on-disk file of this relation; zero means this is a \"mapped\" relation whose disk file name is determined by low-level state"},{"from":"All transaction IDs before this one have been replaced with a permanent (\"frozen\") transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. Zero (InvalidTransactionId) if the relation is not a table","name":"relfrozenxid","to":"All transaction IDs before this one have been replaced with a permanent (\"frozen\") transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. Zero (InvalidTransactionId) if the relation is not a table."},{"from":"True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX, but not cleared immediately by DROP INDEX. VACUUM clears relhasindex if it finds the table has no indexes","name":"relhasindex","to":"True if this is a table and it has (or recently had) any indexes"},{"from":"True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared","name":"relisshared","to":"True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared."},{"from":"True if this table is a temporary relation. If so, only the creating session can safely access its contents","name":"relistemp","to":"True if this table is a temporary relation. If so, only the creating session can safely access its contents."},{"from":"Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum","name":"relnatts","to":"Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum."},{"from":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX","name":"relpages","to":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX."},{"from":"For a TOAST table, the OID of its index. 0 if not a TOAST table","name":"reltoastidxid","to":"For a TOAST table, the OID of its index. 0 if not a TOAST table."},{"from":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes \"out of line\" in a secondary table","name":"reltoastrelid","to":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes \"out of line\" in a secondary table."},{"from":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX","name":"reltuples","to":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX."}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"changed","to":"9.0","types":[],"unlisted":[]},{"added":["relpersistence"],"attributes":[],"description_changed":false,"descriptions":[{"from":"r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table","name":"relkind","to":"r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table, f = foreign table"}],"from":"9.0","listing":[],"order":false,"removed":["relistemp","relhasexclusion"],"status":"changed","to":"9.1","types":[],"unlisted":[]},{"added":["relallvisible"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.1","listing":[],"order":false,"removed":[],"status":"changed","to":"9.2","types":[],"unlisted":[]},{"added":["relispopulated","relminmxid"],"attributes":[],"description_changed":true,"descriptions":[{"from":"r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table, f = foreign table","name":"relkind","to":"r = ordinary table, i = index, S = sequence, v = view, m = materialized view, c = composite type, t = TOAST table, f = foreign table"}],"from":"9.2","listing":[],"order":false,"removed":[],"status":"changed","to":"9.3","types":[],"unlisted":[]},{"added":["relreplident"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.3","listing":[],"order":false,"removed":["reltoastidxid"],"status":"changed","to":"9.4","types":[],"unlisted":[]},{"added":["relrowsecurity","relforcerowsecurity"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Columns used to form \"replica identity\" for rows: d = default (primary key, if any), n = nothing, f = all columns i = index with indisreplident set, or default","name":"relreplident","to":"Columns used to form \"replica identity\" for rows: d = default (primary key, if any), n = nothing, f = all columns, i = index with indisreplident set (same as nothing if the index used has been dropped)"}],"from":"9.4","listing":[],"order":false,"removed":[],"status":"changed","to":"9.5","types":[],"unlisted":[]},{"added":["relispartition","relpartbound"],"attributes":[],"description_changed":true,"descriptions":[{"from":"Name of the on-disk file of this relation; zero means this is a \"mapped\" relation whose disk file name is determined by low-level state","name":"relfilenode","to":"Name of the on-disk file of this relation; zero means this is a “mapped” relation whose disk file name is determined by low-level state"},{"from":"All transaction IDs before this one have been replaced with a permanent (\"frozen\") transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. Zero (InvalidTransactionId) if the relation is not a table.","name":"relfrozenxid","to":"All transaction IDs before this one have been replaced with a permanent (“frozen”) transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_xact to be shrunk. Zero (InvalidTransactionId) if the relation is not a table."},{"from":"r = ordinary table, i = index, S = sequence, v = view, m = materialized view, c = composite type, t = TOAST table, f = foreign table","name":"relkind","to":"r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table"},{"from":"Access-method-specific options, as \"keyword=value\" strings","name":"reloptions","to":"Access-method-specific options, as “keyword=value” strings"},{"from":"Columns used to form \"replica identity\" for rows: d = default (primary key, if any), n = nothing, f = all columns, i = index with indisreplident set (same as nothing if the index used has been dropped)","name":"relreplident","to":"Columns used to form “replica identity” for rows: d = default (primary key, if any), n = nothing, f = all columns, i = index with indisreplident set (same as nothing if the index used has been dropped)"},{"from":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes \"out of line\" in a secondary table.","name":"reltoastrelid","to":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes “out of line” in a secondary table."}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":["relrewrite"],"attributes":[],"description_changed":true,"descriptions":[{"from":"True if table is a partition","name":"relispartition","to":"True if table or index is a partition"},{"from":"r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table","name":"relkind","to":"r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table, I = partitioned index"},{"from":"Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"reltuples","to":"Number of live rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX."}],"from":"10","listing":[],"order":false,"removed":["relhaspkey"],"status":"changed","to":"11","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"hidden","from":true,"name":"oid","to":false}],"description_changed":false,"descriptions":[{"from":"Access privileges; see GRANT and REVOKE for details","name":"relacl","to":"Access privileges; see Section 5.7 for details"},{"from":"If this is an index, the access method used (B-tree, hash, etc.)","name":"relam","to":"If this is a table or an index, the access method used (heap, B-tree, hash, etc.)"},{"from":"True if table has (or once had) any inheritance children","name":"relhassubclass","to":"True if table or index has (or once had) any inheritance children"},{"from":"The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. (Not meaningful if the relation has no on-disk file.)","name":"reltablespace","to":"The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. Not meaningful if the relation has no on-disk file, except for partitioned tables, where this is the tablespace in which partitions will be created when one is not specified in the creation command."}],"from":"11","listing":[],"order":false,"removed":["relhasoids"],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"If this is a table or an index, the access method used (heap, B-tree, hash, etc.)","name":"relam","to":"If this is a table or an index, the access method used (heap, B-tree, hash, etc.); otherwise zero (zero occurs for sequences, as well as relations without storage, such as views)"},{"from":"True if row level security (when enabled) will also apply to table owner; see pg_policy catalog","name":"relforcerowsecurity","to":"True if row-level security (when enabled) will also apply to table owner; see pg_policy catalog"},{"from":"For typed tables, the OID of the underlying composite type, zero for all other relations","name":"reloftype","to":"For typed tables, the OID of the underlying composite type; zero for all other relations"},{"from":"For new relations being written during a DDL operation that requires a table rewrite, this contains the OID of the original relation; otherwise 0. That state is only visible internally; this field should never contain anything other than 0 for a user-visible relation.","name":"relrewrite","to":"For new relations being written during a DDL operation that requires a table rewrite, this contains the OID of the original relation; otherwise zero. That state is only visible internally; this field should never contain anything other than zero for a user-visible relation."},{"from":"True if table has row level security enabled; see pg_policy catalog","name":"relrowsecurity","to":"True if table has row-level security enabled; see pg_policy catalog"},{"from":"OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes “out of line” in a secondary table.","name":"reltoastrelid","to":"OID of the TOAST table associated with this table, zero if none. The TOAST table stores large attributes “out of line” in a secondary table."},{"from":"Number of live rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"reltuples","to":"Number of live rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX. If the table has never yet been vacuumed or analyzed, reltuples contains -1 indicating that the row count is unknown."},{"from":"The OID of the data type that corresponds to this table's row type, if any (zero for indexes, which have no pg_type entry)","name":"reltype","to":"The OID of the data type that corresponds to this table's row type, if any; zero for indexes, sequences, and toast tables, which have no pg_type entry"}],"from":"13","listing":[],"order":false,"removed":[],"status":"reworded","to":"14","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"True if table or index has (or once had) any inheritance children","name":"relhassubclass","to":"True if table or index has (or once had) any inheritance children or partitions"},{"from":"p = permanent table, u = unlogged table, t = temporary table","name":"relpersistence","to":"p = permanent table/sequence, u = unlogged table/sequence, t = temporary table/sequence"}],"from":"14","listing":[],"order":false,"removed":[],"status":"reworded","to":"15","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Access privileges; see Section 5.7 for details","name":"relacl","to":"Access privileges; see Section 5.8 for details"},{"from":"If this is a table or an index, the access method used (heap, B-tree, hash, etc.); otherwise zero (zero occurs for sequences, as well as relations without storage, such as views)","name":"relam","to":"The access method used to access this table or index. Not meaningful if the relation is a sequence or has no on-disk file, except for partitioned tables, where, if set, it takes precedence over default_table_access_method when determining the access method to use for partitions created when one is not specified in the creation command."}],"from":"16","listing":[],"order":false,"removed":[],"status":"reworded","to":"17","types":[],"unlisted":[]},{"added":["relallfrozen"],"attributes":[],"description_changed":false,"descriptions":[],"from":"17","listing":[],"order":false,"removed":[],"status":"changed","to":"18","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Access privileges; see Section 5.8 for details","name":"relacl","to":"Access privileges; see Section 5.9 for details"},{"from":"The OID of the data type that corresponds to this table's row type, if any; zero for indexes, sequences, and toast tables, which have no pg_type entry","name":"reltype","to":"The OID of the data type that corresponds to this table's row type, if any; zero for indexes, sequences, and TOAST tables, which have no pg_type entry"}],"from":"18","listing":[],"order":false,"removed":[],"status":"reworded","to":"19","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Number of pages that are marked all-frozen in the table's visibility map. This is only an estimate used for triggering autovacuums. It can also be used along with relallvisible for scheduling manual vacuums and tuning vacuum's freezing behavior. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"relallfrozen","to":"Number of pages that are marked all-frozen in the table's visibility map. This is only an estimate used for triggering autovacuums. It can also be used along with relallvisible for scheduling manual vacuums and tuning vacuum's freezing behavior. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.\n\nThis is effectively an unsigned 32-bit integer; values larger than 231−1 are stored as negative values."},{"from":"Number of pages that are marked all-visible in the table's visibility map. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"relallvisible","to":"Number of pages that are marked all-visible in the table's visibility map. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.\n\nThis is effectively an unsigned 32-bit integer; values larger than 231−1 are stored as negative values."},{"from":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","name":"relpages","to":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.\n\nThis is effectively an unsigned 32-bit integer; values larger than 231−1 are stored as negative values."}],"from":"19","listing":[],"order":false,"removed":[],"status":"reworded","to":"20","types":[],"unlisted":[]}],"column_count":34,"content_hash":"3a6dc8fadabd7b3493e0d85ac1aa2b6546a8b801d98cdb09c9b7646c1f961085","first_version":"7.4","imported_at":"2026-09-30T00:40:55.410695+08:00","kind":"catalog","last_version":"20","name":"pg_class","position":14,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:ea8872f33d2fe5c3e602b22cd56700b9d92f1a106fd1b4da3ff8e1290dd6b8cc","summary":"The catalog pg_class describes tables and other objects that have columns or are otherwise similar to a table.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_class","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_class","SourceRevision":"english-manuals:ea8872f33d2fe5c3e602b22cd56700b9d92f1a106fd1b4da3ff8e1290dd6b8cc","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Row identifier","description_zh":"","documented":true,"documented_name":"oid","hidden":false,"name":"oid","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"Name of the table, index, view, etc.","description_zh":"","documented":true,"documented_name":"relname","hidden":false,"name":"relname","not_null":true,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"The OID of the namespace that contains this relation","description_zh":"","documented":true,"documented_name":"relnamespace","hidden":false,"name":"relnamespace","not_null":true,"references":"pg_namespace.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"The OID of the data type that corresponds to this table's row type, if any; zero for indexes, sequences, and toast tables, which have no pg_type entry","description_zh":"","documented":true,"documented_name":"reltype","hidden":false,"name":"reltype","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":5,"description":"For typed tables, the OID of the underlying composite type; zero for all other relations","description_zh":"","documented":true,"documented_name":"reloftype","hidden":false,"name":"reloftype","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":6,"description":"Owner of the relation","description_zh":"","documented":true,"documented_name":"relowner","hidden":false,"name":"relowner","not_null":true,"references":"pg_authid.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":7,"description":"The access method used to access this table or index. Not meaningful if the relation is a sequence or has no on-disk file, except for partitioned tables, where, if set, it takes precedence over default_table_access_method when determining the access method to use for partitions created when one is not specified in the creation command.","description_zh":"","documented":true,"documented_name":"relam","hidden":false,"name":"relam","not_null":true,"references":"pg_am.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":8,"description":"Name of the on-disk file of this relation; zero means this is a “mapped” relation whose disk file name is determined by low-level state","description_zh":"","documented":true,"documented_name":"relfilenode","hidden":false,"name":"relfilenode","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":9,"description":"The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. Not meaningful if the relation has no on-disk file, except for partitioned tables, where this is the tablespace in which partitions will be created when one is not specified in the creation command.","description_zh":"","documented":true,"documented_name":"reltablespace","hidden":false,"name":"reltablespace","not_null":true,"references":"pg_tablespace.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":10,"description":"Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","description_zh":"","documented":true,"documented_name":"relpages","hidden":false,"name":"relpages","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":11,"description":"Number of live rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX. If the table has never yet been vacuumed or analyzed, reltuples contains -1 indicating that the row count is unknown.","description_zh":"","documented":true,"documented_name":"reltuples","hidden":false,"name":"reltuples","not_null":true,"references":"","type":"float4","type_modifier":-1,"type_oid":700},{"array_dimensions":0,"attnum":12,"description":"Number of pages that are marked all-visible in the table's visibility map. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","description_zh":"","documented":true,"documented_name":"relallvisible","hidden":false,"name":"relallvisible","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":13,"description":"Number of pages that are marked all-frozen in the table's visibility map. This is only an estimate used for triggering autovacuums. It can also be used along with relallvisible for scheduling manual vacuums and tuning vacuum's freezing behavior. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX.","description_zh":"","documented":true,"documented_name":"relallfrozen","hidden":false,"name":"relallfrozen","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":14,"description":"OID of the TOAST table associated with this table, zero if none. The TOAST table stores large attributes “out of line” in a secondary table.","description_zh":"","documented":true,"documented_name":"reltoastrelid","hidden":false,"name":"reltoastrelid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":15,"description":"True if this is a table and it has (or recently had) any indexes","description_zh":"","documented":true,"documented_name":"relhasindex","hidden":false,"name":"relhasindex","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":16,"description":"True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared.","description_zh":"","documented":true,"documented_name":"relisshared","hidden":false,"name":"relisshared","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":17,"description":"p = permanent table/sequence, u = unlogged table/sequence, t = temporary table/sequence","description_zh":"","documented":true,"documented_name":"relpersistence","hidden":false,"name":"relpersistence","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":18,"description":"r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table, I = partitioned index","description_zh":"","documented":true,"documented_name":"relkind","hidden":false,"name":"relkind","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":19,"description":"Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum.","description_zh":"","documented":true,"documented_name":"relnatts","hidden":false,"name":"relnatts","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":20,"description":"Number of CHECK constraints on the table; see pg_constraint catalog","description_zh":"","documented":true,"documented_name":"relchecks","hidden":false,"name":"relchecks","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":21,"description":"True if table has (or once had) rules; see pg_rewrite catalog","description_zh":"","documented":true,"documented_name":"relhasrules","hidden":false,"name":"relhasrules","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":22,"description":"True if table has (or once had) triggers; see pg_trigger catalog","description_zh":"","documented":true,"documented_name":"relhastriggers","hidden":false,"name":"relhastriggers","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":23,"description":"True if table or index has (or once had) any inheritance children or partitions","description_zh":"","documented":true,"documented_name":"relhassubclass","hidden":false,"name":"relhassubclass","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":24,"description":"True if table has row-level security enabled; see pg_policy catalog","description_zh":"","documented":true,"documented_name":"relrowsecurity","hidden":false,"name":"relrowsecurity","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":25,"description":"True if row-level security (when enabled) will also apply to table owner; see pg_policy catalog","description_zh":"","documented":true,"documented_name":"relforcerowsecurity","hidden":false,"name":"relforcerowsecurity","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":26,"description":"True if relation is populated (this is true for all relations other than some materialized views)","description_zh":"","documented":true,"documented_name":"relispopulated","hidden":false,"name":"relispopulated","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":27,"description":"Columns used to form “replica identity” for rows: d = default (primary key, if any), n = nothing, f = all columns, i = index with indisreplident set (same as nothing if the index used has been dropped)","description_zh":"","documented":true,"documented_name":"relreplident","hidden":false,"name":"relreplident","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":28,"description":"True if table or index is a partition","description_zh":"","documented":true,"documented_name":"relispartition","hidden":false,"name":"relispartition","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":29,"description":"For new relations being written during a DDL operation that requires a table rewrite, this contains the OID of the original relation; otherwise zero. That state is only visible internally; this field should never contain anything other than zero for a user-visible relation.","description_zh":"","documented":true,"documented_name":"relrewrite","hidden":false,"name":"relrewrite","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":30,"description":"All transaction IDs before this one have been replaced with a permanent (“frozen”) transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_xact to be shrunk. Zero (InvalidTransactionId) if the relation is not a table.","description_zh":"","documented":true,"documented_name":"relfrozenxid","hidden":false,"name":"relfrozenxid","not_null":true,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":31,"description":"All multixact IDs before this one have been replaced by a transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent multixact ID wraparound or to allow pg_multixact to be shrunk. Zero (InvalidMultiXactId) if the relation is not a table.","description_zh":"","documented":true,"documented_name":"relminmxid","hidden":false,"name":"relminmxid","not_null":true,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":1,"attnum":32,"description":"Access privileges; see Section 5.8 for details","description_zh":"","documented":true,"documented_name":"relacl","hidden":false,"name":"relacl","not_null":false,"references":"","type":"aclitem[]","type_modifier":-1,"type_oid":1034},{"array_dimensions":1,"attnum":33,"description":"Access-method-specific options, as “keyword=value” strings","description_zh":"","documented":true,"documented_name":"reloptions","hidden":false,"name":"reloptions","not_null":false,"references":"","type":"text[]","type_modifier":-1,"type_oid":1009},{"array_dimensions":0,"attnum":34,"description":"If table is a partition (see relispartition), internal representation of the partition bound","description_zh":"","documented":true,"documented_name":"relpartbound","hidden":false,"name":"relpartbound","not_null":false,"references":"","type":"pg_node_tree","type_modifier":-1,"type_oid":194}],"description":"The catalog pg_class describes tables and other objects that have columns or are otherwise similar to a table. This includes indexes (but see also pg_index), sequences (but see also pg_sequence), views, materialized views, composite types, and TOAST tables; see relkind. Below, when we mean all of these kinds of objects we speak of “relations”. Not all of pg_class's columns are meaningful for all relation kinds.","description_zh":"","doc":{"anchor":"id-1.10.4.13.4","file":"catalog-pg-class.html","lang":"en","sha256":"28f0d129862276ad67ce6e58d82b9ef6ca6b3b312eb0f77803c9f54b3d9a13fc","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","relname","relnamespace","reltype","reloftype","relowner","relam","relfilenode","reltablespace","relpages","reltuples","relallvisible","relallfrozen","reltoastrelid","relhasindex","relisshared","relpersistence","relkind","relnatts","relchecks","relhasrules","relhastriggers","relhassubclass","relrowsecurity","relforcerowsecurity","relispopulated","relreplident","relispartition","relrewrite","relfrozenxid","relminmxid","relacl","reloptions","relpartbound"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.13.4","file":"catalog-pg-class.html","lang":"en","sha256":"28f0d129862276ad67ce6e58d82b9ef6ca6b3b312eb0f77803c9f54b3d9a13fc","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","relname","relnamespace","reltype","reloftype","relowner","relam","relfilenode","reltablespace","relpages","reltuples","relallvisible","relallfrozen","reltoastrelid","relhasindex","relisshared","relpersistence","relkind","relnatts","relchecks","relhasrules","relhastriggers","relhassubclass","relrowsecurity","relforcerowsecurity","relispopulated","relreplident","relispartition","relrewrite","relfrozenxid","relminmxid","relacl","reloptions","relpartbound"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_class","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_class","Summary":"目录pg_class描述了表以及其他具有列或在其他方面与表类似的对象。这包括索引（但请参见pg_index）、序列（但请参见pg_sequence）、视图、物化视图、复合类型和TOAST表；请参见relkind。在下面，当我们指的是所有这些类型的对象时，我们称之为“关系（relations）”。并非所有pg_class的列对所有关系类型都有意义。","BodyHTML":"\u003cp\u003e目录pg_class描述了表以及其他具有列或在其他方面与表类似的对象。这包括索引（但请参见pg_index）、序列（但请参见pg_sequence）、视图、物化视图、复合类型和TOAST表；请参见relkind。在下面，当我们指的是所有这些类型的对象时，我们称之为“关系（relations）”。并非所有pg_class的列对所有关系类型都有意义。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"915bcfc46f482c1d9b09cd3570ac1888312cfe024281b64163a7c4ddf0f586a4","Payload":{"columns":[{"description_zh":"行标识符","name":"oid","type":"oid","zh_from":"doc"},{"description_zh":"表、索引、视图等的名字","name":"relname","type":"name","zh_from":"doc"},{"description_zh":"包含该关系的名字空间的OID","name":"relnamespace","type":"oid","zh_from":"doc"},{"description_zh":"与此表的行类型对应的数据类型的 OID（如有）；索引、序列和 TOAST 表没有pg_type项，此值为零","name":"reltype","type":"oid","zh_from":"doc"},{"description_zh":"对于类型化表，为底层复合类型的 OID；对于其他所有关系则为零","name":"reloftype","type":"oid","zh_from":"doc"},{"description_zh":"关系的拥有者","name":"relowner","type":"oid","zh_from":"doc"},{"description_zh":"用于访问该表或索引的访问方法。如果该关系是序列或者没有磁盘文件，则此字段无意义；分区表除外，对于分区表，如果设置了该字段，则在创建命令未指定时，它优先于 default_table_access_method 来决定用于创建分区的访问方法。","name":"relam","type":"oid","zh_from":"doc"},{"description_zh":"该关系的磁盘文件名；零表示这是一个“映射”关系，其磁盘文件名取决于底层状态","name":"relfilenode","type":"oid","zh_from":"doc"},{"description_zh":"存储此关系的表空间。如果为零，则表示使用数据库的默认表空间。对于没有磁盘文件的关系，此值没有意义，但分区表除外：若创建命令未指定表空间，将在此表空间中创建分区。","name":"reltablespace","type":"oid","zh_from":"doc"},{"description_zh":"该表磁盘表示的尺寸，以页面计（页面尺寸为BLCKSZ）。这只是一个由规划器使用的估计值。它被VACUUM、ANALYZE以及一些DDL命令（如CREATE INDEX）所更新。","name":"relpages","type":"integer","zh_from":"doc"},{"description_zh":"表中的存活行数。这只是一个由规划器使用的估计值。它被VACUUM、ANALYZE以及一些DDL命令（如CREATE INDEX）所更新。如果该表从未被清理或分析，包含-1的reltuples表示行数是未知的。","name":"reltuples","type":"real","zh_from":"doc"},{"description_zh":"在表的可见性映射中被标记为全可见的页数。这只是一个由规划器使用的估计值。它被VACUUM、ANALYZE以及一些DDL命令，如CREATE INDEX所更新。","name":"relallvisible","type":"integer","zh_from":"doc"},{"description_zh":"表的可见性映射中被标记为全冻结的页数。这只是一个用于触发自动清理的估计值。它也可以与 relallvisible 一起，用于安排手工清理以及调优清理冻结行为。它会被 VACUUM、ANALYZE 以及一些 DDL 命令（例如 CREATE INDEX）更新。","name":"relallfrozen","type":"integer","zh_from":"doc"},{"description_zh":"与该表相关联的TOAST表的OID，如果没有则为零。TOAST表将大属性“行外”存储在一个二级表中。","name":"reltoastrelid","type":"oid","zh_from":"doc"},{"description_zh":"如果这是一个表并且其上建有（或最近建有）索引则为真","name":"relhasindex","type":"boolean","zh_from":"doc"},{"description_zh":"如果该表在集簇中的所有数据库间共享则为真。只有某些系统目录（如pg_database）是共享的。","name":"relisshared","type":"boolean","zh_from":"doc"},{"description_zh":"p = 永久表/序列，u = 不记录 WAL 的表/序列，t = 临时表/序列","name":"relpersistence","type":"\"char\"","zh_from":"doc"},{"description_zh":"r = 普通表，i = 索引，S = 序列，t = TOAST表，v = 视图，m = 物化视图，c = 复合类型，f = 外部表，p = 分区表，I = 分区索引","name":"relkind","type":"\"char\"","zh_from":"doc"},{"description_zh":"关系中用户列的数量（不计系统列）。在pg_attribute中必须有这么多对应项。另请参阅pg_attribute.attnum。","name":"relnatts","type":"smallint","zh_from":"doc"},{"description_zh":"表上CHECK约束的数目，参见pg_constraint目录","name":"relchecks","type":"smallint","zh_from":"doc"},{"description_zh":"如果表有（或曾有）规则则为真，参见pg_rewrite目录","name":"relhasrules","type":"boolean","zh_from":"doc"},{"description_zh":"如果表有（或曾有）触发器则为真，参见 pg_trigger目录","name":"relhastriggers","type":"boolean","zh_from":"doc"},{"description_zh":"如果表或索引有（或曾经有过）任何继承子对象或分区，则为真","name":"relhassubclass","type":"boolean","zh_from":"doc"},{"description_zh":"如果表上启用了行级安全则为真，参见 pg_policy目录","name":"relrowsecurity","type":"boolean","zh_from":"doc"},{"description_zh":"如果行级安全（启用时）也适用于表拥有者则为真，参见 pg_policy目录","name":"relforcerowsecurity","type":"boolean","zh_from":"doc"},{"description_zh":"如果关系已被填充则为真（对于所有关系该列都为真，但对于某些物化视图却不是）","name":"relispopulated","type":"boolean","zh_from":"doc"},{"description_zh":"用于形成行“复制标识”的列：d = 默认（主键，如果存在），n = 无，f = 所有列，i = 设置了indisreplident的索引（如果该索引已被删除，则效果等同于无）","name":"relreplident","type":"\"char\"","zh_from":"doc"},{"description_zh":"如果表或索引是一个分区，则为真","name":"relispartition","type":"boolean","zh_from":"doc"},{"description_zh":"对于在需要重写表的 DDL 操作期间写入的新关系，此字段包含原关系的 OID；其他情况下为零。该状态仅在内部可见；对于用户可见的关系，此字段应始终为零。","name":"relrewrite","type":"oid","zh_from":"doc"},{"description_zh":"在此之前的所有事务ID在表中已经被替换为一个永久的（“冻结的”）事务ID。这用于跟踪表是否需要被清理，以便阻止事务ID回卷或者允许pg_xact被收缩。如果该关系不是一个表则为0（InvalidTransactionId）。","name":"relfrozenxid","type":"xid","zh_from":"doc"},{"description_zh":"在此之前的所有多事务ID在表中已经被替换为一个事务ID。这被用于跟踪表是否需要被清理，以阻止多事务ID回卷或者允许pg_multixact被收缩。如果关系不是一个表则为0（InvalidMultiXactId）。","name":"relminmxid","type":"xid","zh_from":"doc"},{"description_zh":"访问权限，更多信息参见第 5.8 节","name":"relacl","type":"aclitem[]","zh_from":"doc"},{"description_zh":"访问方法相关的选项，以“keyword=value”字符串形式","name":"reloptions","type":"text[]","zh_from":"doc"},{"description_zh":"如果表是一个分区（见relispartition），则为分区边界的内部表示","name":"relpartbound","type":"pg_node_tree","zh_from":"doc"}],"description_zh":"目录pg_class描述了表以及其他具有列或在其他方面与表类似的对象。这包括索引（但请参见pg_index）、序列（但请参见pg_sequence）、视图、物化视图、复合类型和TOAST表；请参见relkind。在下面，当我们指的是所有这些类型的对象时，我们称之为“关系（relations）”。并非所有pg_class的列对所有关系类型都有意义。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
