pg_inherits 是一个 系统目录 表,用于存储有关表继承层次结构的信息。
pg_inherits 一直存在于 PostgreSQL 中。
按 PostgreSQL 版本定义
pg_inherits (PostgreSQL 19)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 18)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 17)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 16)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 15)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 14)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
inhdetachpending | boolean | | not null |
Indexes:
"pg_inherits_relid_seqno_index" PRIMARY KEY, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 13)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
-----------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
Indexes:
"pg_inherits_parent_index" btree (inhparent)
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
文档: pg_inherits
pg_inherits (PostgreSQL 12)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
-----------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 11)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
-----------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 10)
Table "pg_catalog.pg_inherits"
Column | Type | Collation | Nullable | Default
-----------+---------+-----------+----------+---------
inhrelid | oid | | not null |
inhparent | oid | | not null |
inhseqno | integer | | not null |
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.6)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.5)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.4)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.3)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.2)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.1)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 9.0)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
"pg_inherits_parent_index" btree (inhparent)
文档: pg_inherits
pg_inherits (PostgreSQL 8.4)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
文档: pg_inherits
pg_inherits (PostgreSQL 8.3)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
文档: pg_inherits
pg_inherits (PostgreSQL 8.2)
Table "pg_catalog.pg_inherits"
Column | Type | Modifiers
-----------+---------+-----------
inhrelid | oid | not null
inhparent | oid | not null
inhseqno | integer | not null
Indexes:
"pg_inherits_relid_seqno_index" UNIQUE, btree (inhrelid, inhseqno)
文档: pg_inherits
更改历史
- PostgreSQL 14
- 添加了列
inhdetachpending(提交 71f4c8c6)
- 添加了列
pg_inherits 一直存在于 PostgreSQL 中。
参考资料
- PostgreSQL 文档: pg_inherits
