ALTER_RULE(7pg16)
π ALTER RULE (7) β the glow-up page for your rules
ok so bestie, welcome to the <pink>PostgreSQL 16.15</pink> corner of the manual that's literally just about renaming rules. That's it. That's the whole vibe. It's short, it's sweet, it's giving "micro-manpage" energy and honestly? We love a concise icon. β¨
β¨ NAME β¨
ALTER_RULE β change the definition of a rule π
πΈ SYNOPSIS πΈ
ALTER RULE name ON table_name RENAME TO new_name
That's the one and only shape this command comes in, no cap.
π DESCRIPTION π
So here's the tea: ALTER RULE changes properties of an existing rule. And when I say "properties," I mean... okay don't get too excited, because right now the only available action is changing the rule's name. That's the entire menu. One item. A solo act. Main character energy, honestly. π
But real talk before you go renaming things: to use ALTER RULE, you must own the table or view that the rule applies to. Not vibes-based ownership, actual ownership. If it's not yours, the answer is no. π
π¦ PARAMETERS π¦
nameβ the name of an existing rule you wanna alter. Gotta be a rule that's already out here existing, bestie.table_nameβ the name (optionally schema-qualified) of the table or view that the rule applies to. Yes, optional schema qualification is allowed, we're fancy like that. πnew_nameβ the new name for the rule. The fresh identity. The rebrand. π¦
β EXAMPLES β
Wanna rename an existing rule? Say less. Here's the whole move:
ALTER RULE notify_all ON emp RENAME TO notify_me;
Look at that. notify_all walked in, notify_me walked out. Iconic. π₯
π COMPATIBILITY π
ALTER RULE is a <purple>PostgreSQL language extension</purple> β and ngl, so is the entire query rewrite system. So if you're out here expecting this to be standard SQL... it's not, and that's just how it is, fr fr. π«Ά
π SEE ALSO π
CREATE RULE(CREATE_RULE(7))DROP RULE(DROP_RULE(7))
okay that's genuinely the whole page, no filler, no extra lore π if you came here looking for forty options you're in the wrong manpage, bestie β this one's a one-trick pony and she's slaying at it π
PostgreSQL 16.15 Β· <lavender>2026</lavender> Β· ALTER RULE(7) β mwah, go forth and rename responsibly, iykyk πΈπ§π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-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