ALTER_CONVERSION(7pg16)

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

okay bestie, welcome to ALTER_CONVERSION(7pg16) β€” the PostgreSQL 16.15 docs page that’s literally all about changing a conversion’s definition. vibe check: tiny page, big ownership energy πŸ’…βœ¨


πŸ’– NAME πŸ’–

ALTER_CONVERSION β€” change the definition of a conversion. That’s the whole assignment, no cap πŸŽ€

✨ SYNOPSIS ✨

ALTER CONVERSION name RENAME TO new_name
ALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER CONVERSION name SET SCHEMA new_schema

🌸 DESCRIPTION 🌸

So ALTER CONVERSION changes the definition of a conversion. Iconic, straightforward, we love to see it πŸ¦‹

To use ALTER CONVERSION, you gotta own the conversion. That’s the entry fee, bestie πŸ’…

To alter the owner, you must be able to SET ROLE to the new owning role, and that role must have CREATE privilege on the conversion’s schema. These restrictions enforce that altering the owner doesn’t do anything you couldn’t do by dropping and recreating the conversion. Basically the guardrails are guardrailing 🫢

But plot twist: a superuser can alter ownership of any conversion anyway. Main character energy, honestly πŸ‘‘

πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name (optionally schema-qualified) of an existing conversion. Yes, schema-qualified is allowed, we love flexibility ✨
  • new_name β€” the new name of the conversion. Fresh name, fresh vibe 🌈
  • new_owner β€” the new owner of the conversion. Handing over the keys πŸ”‘
  • new_schema β€” the new schema for the conversion. Moving day, but make it SQL πŸ“¦

πŸ’œ EXAMPLES πŸ’œ

To rename the conversion iso_8859_1_to_utf8 to latin1_to_unicode:

ALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode;

To change the owner of the conversion iso_8859_1_to_utf8 to joe:

ALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;

See? Short, sweet, slays every time πŸ’…βœ¨

πŸ¦‹ COMPATIBILITY πŸ¦‹

There is no ALTER CONVERSION statement in the SQL standard. The SQL standard said β€œnot me,” and honestly we respect the honesty πŸ˜­πŸ’€

🌟 SEE ALSO 🌟

Go read those too, bestie β€” completionist behavior is very demure, very mindful πŸŽ€


Big kiss from ALTER CONVERSION(7) πŸ’‹ β€” source/version: PostgreSQL 16.15, date: 2026. Now go alter those conversions responsibly, queen πŸ‘‘βœ¨
πŸ“¦ where this page comes from