pg_rewrite

A system catalogue table containing rewrite rules for tables and views

pg_rewrite is a system catalogue table containing rewrite rules for tables and views

pg_rewrite has been present in all PostgreSQL versions.

Definition by PostgreSQL version

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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: 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)
    

Documentation: pg_rewrite

Change history

Note: list does not contain any changes made before PostgreSQL 8.2.

Categories

DDL, System catalogue