ALTER_RULE(7pg14)

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

✨ NAME ✨

okay so welcome to the ALTER RULE(7) page from the PostgreSQL 14.24 documentation πŸ’… the main character here is ALTER_RULE β€” it changes 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. ✨

To use ALTER RULE, you must own the table or view that the rule applies to. No cap β€” that ownership requirement is literally part of the vibe check. 🫢

bestie, if you don’t own the table or view the rule applies to, this is not your moment πŸ’€

πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of an existing rule to alter. like, which rule are we giving a glow-up? πŸ’…
  • table_name β€” the name (optionally schema-qualified) of the table or view that the rule applies to. πŸ¦‹
  • new_name β€” the new name for the rule. fresh name, who dis? πŸŽ€

πŸ”₯ 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 πŸ‘‘


mwah πŸ’‹ that’s the whole page β€” PostgreSQL 14.24, dated 2026, ALTER RULE(7) out. πŸ‘‘

πŸ“¦ where this page comes from