ALTER RULE (original) (raw)

This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for thecurrent version, or one of the other supported versions listed above instead.

ALTER RULE — change the definition of a rule

Synopsis

ALTER RULE name ON tablename RENAME TO newname

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

name

The name of an existing rule to alter.

tablename

The name (optionally schema-qualified) of the table or view that the rule applies to.

newname

The 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.