pg_rewrite
是一个包含表和视图重写规则的系统目录表。
pg_rewrite
在所有PostgreSQL版本中都存在。
用法
pg_rewrite
旨在用于内部用途。使用视图pg_rules
获取pg_rewrite
内容的人类可读版本。
按PostgreSQL版本定义
pg_rewrite (PostgreSQL 18)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" PRIMARY KEY, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE CONSTRAINT, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 17)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" PRIMARY KEY, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE CONSTRAINT, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 16)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" PRIMARY KEY, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE CONSTRAINT, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 15)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" PRIMARY KEY, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE CONSTRAINT, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 14)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" PRIMARY KEY, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE CONSTRAINT, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 13)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 12)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- oid | oid | | not null | rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | C | not null | ev_action | pg_node_tree | C | not null | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 11)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | | | ev_action | pg_node_tree | | | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 10)
Table "pg_catalog.pg_rewrite" Column | Type | Collation | Nullable | Default ------------+--------------+-----------+----------+--------- rulename | name | | not null | ev_class | oid | | not null | ev_type | "char" | | not null | ev_enabled | "char" | | not null | is_instead | boolean | | not null | ev_qual | pg_node_tree | | | ev_action | pg_node_tree | | | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.6)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.5)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.4)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.3)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.2)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.1)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+--------------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | pg_node_tree | ev_action | pg_node_tree | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 9.0)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+----------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | text | ev_action | text | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 8.4)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+----------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | text | ev_action | text | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 8.3)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+----------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null ev_enabled | "char" | not null is_instead | boolean | not null ev_qual | text | ev_action | text | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
pg_rewrite (PostgreSQL 8.2)
Table "pg_catalog.pg_rewrite" Column | Type | Modifiers ------------+----------+----------- rulename | name | not null ev_class | oid | not null ev_attr | smallint | not null ev_type | "char" | not null is_instead | boolean | not null ev_qual | text | ev_action | text | Indexes: "pg_rewrite_oid_index" UNIQUE, btree (oid) "pg_rewrite_rel_rulename_index" UNIQUE, btree (ev_class, rulename)
文档: pg_rewrite
更改历史
注意:列表不包含PostgreSQL 8.2之前所做的任何更改。
- PostgreSQL 9.4
- 列
ev_attr
已移除 (提交277607d6)
- 列
- PostgreSQL 9.1
- 列
ev_qual
更改为类型pg_node_tree
(提交303696c3) - 列
ev_action
更改为类型pg_node_tree
(提交303696c3)
- 列
- PostgreSQL 8.3
- 列
ev_enabled
已添加 (提交0fe16500)
- 列
参考文献
- PostgreSQL文档: pg_rewrite