ALTER_RULE(7pg13)
πΈ NAME πΈ
okay bestie, welcome to the ALTER_RULE(7pg13) page β ALTER_RULE is literally the command for change the definition of a rule. tiny name, real power, we love to see it π
β¨ SYNOPSIS β¨
ALTER RULE name ON table_name RENAME TO new_name
π DESCRIPTION π
So 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 rn, no cap.
To use ALTER RULE, you must own the table or view that the rule applies to. like, itβs not giving βborrow your bestieβs rule and rename it,β okay? ownership check says hi π
π PARAMETERS π
nameβ the name of an existing rule to alter. this is the rule youβre giving a glow-up / new identity β¨table_nameβ the name (optionally schema-qualified) of the table or view that the rule applies to. yes, the table or view it belongs to, bestie πnew_nameβ the new name for the rule. fresh name, same rule, iconic behavior π
π¦ EXAMPLES π¦
To rename an existing rule:
ALTER RULE notify_all ON emp RENAME TO notify_me;
see? notify_all said βnot me anymore,β and now itβs notify_me. weβre obsessed π«Ά
π COMPATIBILITY π
ALTER RULE is a PostgreSQL language extension, as is the entire query rewrite system. so yeah, this is very much a PostgreSQL-specific vibe β iykyk π
π SEE ALSO π
CREATE RULE(CREATE_RULE(7))DROP RULE(DROP_RULE(7))
mwah π this lil page is from PostgreSQL 13.23 documentation, dated 2025 β now go forth and rename responsibly, bestie π§β¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms