pg_rewrite
The catalog pg_rewrite stores rewrite rules for tables and views.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- kind
- catalog
- lang
- en
- measured attributes
- true
- metadata release
- 18.6
- runtime columns
- oid, rulename, ev_class, ev_type, ev_enabled, is_instead, ev_qual, ev_action
- runtime verified
- false
- source
- english-manual
Definition PG 18
The catalog pg_rewrite stores rewrite rules for tables and views.
Catalog columns
| Column | Type | Nullability | Description |
|---|---|---|---|
| oid | oid | Not null | Row identifier |
| rulename | name | Not null | Rule name |
| ev_class | oid | Not null | The table this rule is for |
| ev_type | char | Not null | Event type that the rule is for: 1 = SELECT, 2 = UPDATE, 3 = INSERT, 4 = DELETE |
| ev_enabled | char | Not null | Controls in which session_replication_role modes the rule fires. O = rule fires in “origin” and “local” modes, D = rule is disabled, R = rule fires in “replica” mode, A = rule fires always. |
| is_instead | bool | Not null | True if the rule is an INSTEAD rule |
| ev_qual | pg_node_tree | Not null | Expression tree (in the form of a nodeToString() representation) for the rule's qualifying condition |
| ev_action | pg_node_tree | Not null | Query tree (in the form of a nodeToString() representation) for the rule's action |
Compare versions
Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · catalog-bilingual-repair:e7ccb909b3519dbb88e4822ddb088fcf39f96eee4b30d86491e19adcd850d18f
Text language: en · catalog-bilingual-repair:e7ccb909b3519dbb88e4822ddb088fcf39f96eee4b30d86491e19adcd850d18f