Help Center > > Developer Guide> System Catalogs and System Views> System Catalogs> PG_REWRITE

PG_REWRITE

Updated at: Jul 15, 2020 GMT+08:00

PG_REWRITE records rewrite rules defined for tables and views.

Table 1 PG_REWRITE columns

Name

Type

Description

rulename

name

Rule Name

ev_class

oid

Name of the table that uses the rule

ev_attr

smallint

Column this rule is for (always zero to indicate the entire table)

ev_type

"char"

Event type for this rule:

  • 1 = SELECT
  • 2 = UPDATE
  • 3 = INSERT
  • 4 = DELETE

ev_enabled

"char"

Controls in which mode the rule fires

  • O = rule fires in "origin" and "local" modes
  • D = rule is disabled
  • R = rule fires in "replica" mode
  • A = rule always fires

is_instead

Boolean

Its value is true if the rule is an INSTEAD rule.

ev_qual

pg_node_tree

Expression tree (in the form of a nodeToString() representation) for the rule's qualifying condition

ev_action

pg_node_tree

Query tree (in the form of a nodeToString() representation) for the rule's action

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel