ALTER RULE
Read PG 18 manual ↗change the definition of a rule
Syntax
ALTER RULE name ON table_name RENAME TO new_name
Syntax diagrams
Read left to right. Branches are choices, bypasses are optional, loops repeat. Select an underlined parameter to open its rule.
Description
ALTER RULE changes properties of an existing rule. Currently, the only available action is to change the rule's name.
To use ALTER RULE, you must own the table or view that the rule applies to.
Parameters
nameThe name of an existing rule to alter.
table_nameThe name (optionally schema-qualified) of the table or view that the rule applies to.
new_nameThe new name for the rule.
Examples
To rename an existing rule:
ALTER RULE notify_all ON emp RENAME TO notify_me;
Compatibility
ALTER RULE is a PostgreSQL language extension, as is the entire query rewrite system.
See Also
CREATE RULE, DROP RULERelated entries
Definition snapshot: 2026-09-14T13:14:25.700916+00:00@99e6866c · English manual source