ALTER_RULE(7pg17)

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

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to the ALTER_RULE(7pg17) page β€” up top it’s literally ALTER RULE(7) β€” from the PostgreSQL 17.11 Documentation πŸ’…βœ¨. This manual is called ALTER_RULE, and 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 β€” that’s the whole menu, no cap πŸ“.

To use ALTER RULE, you must own the table or view that the rule applies to. Like, you gotta be the owner-owner, bestie πŸ‘‘.

🌸 PARAMETERS 🌸

  • name β€” the name of an existing rule to alter. Yep, the rule has to already exist πŸ’–.
  • table_name β€” the name (optionally schema-qualified) of the table or view that the rule applies to. Schema-qualified is allowed, iconically ✨.
  • new_name β€” the new name for the rule. Fresh name, same rule, slay πŸ¦‹.

πŸ¦‹ EXAMPLES πŸ¦‹

To rename an existing rule, you literally do this:

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. So yeah, this is Postgres-specific territory, bestie β€” periodt πŸ’….

🧚 SEE ALSO 🧚


mwah πŸ’– that’s the whole page β€” source/version: PostgreSQL 17.11, date: 2026, and the manual page is ALTER RULE(7). byeee 🫢✨

πŸ“¦ where this page comes from