ALTER_RULE(7pg15)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸ’– ALTER_RULE πŸ’–

okay so this is ALTER_RULE(7pg15) from the PostgreSQL 15.19 docs β€” the manual page for changing a rule’s definition, and it’s literally giving β€œsmall but mighty” ✨


πŸŽ€ NAME πŸŽ€

ALTER_RULE β€” change the definition of a rule πŸ’…

✨ SYNOPSIS ✨

ALTER RULE name ON table_name RENAME TO new_name

πŸ¦‹ DESCRIPTION πŸ¦‹

ALTER RULE changes properties of an existing rule. Currently, the only available action is to change the rule’s name. That’s it β€” one action, zero extra drama πŸŽ€

To use ALTER RULE, you must own the table or view that the rule applies to. Ownership check says slay or stay home, bestie πŸ‘‘

🌸 PARAMETERS 🌸

  • name β€” the name of an existing rule to alter.
  • table_name β€” the name of the table or view that the rule applies to; it can be optionally schema-qualified.
  • new_name β€” 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 β€” and so is the entire query rewrite system. PostgreSQL extension vibes, periodt πŸ‘‘

🫢 SEE ALSO 🫢


xoxo, your PostgreSQL 15.19 doc bestie πŸ’– β€” dated 2026, no cap.

πŸ“¦ where this page comes from