ALTER_CONVERSION(7pg18)

๐Ÿ“ฆ version 18.6, in opensuse-leap 16.0

โœจ ALTER_CONVERSION โœจ

okay bestie, so ALTER_CONVERSION is a PostgreSQL thing and it's literally the manual page for changing the definition of a conversion. that's the NAME section, we're done with it, moving on ๐Ÿ’…


๐ŸŒธ 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

three whole moves. pick your fighter. ๐ŸŽ€


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so like. ALTER CONVERSION changes the definition of a conversion. that's the whole vibe. โœจ

now the important part, no cap โ€” you must own the conversion to use ALTER CONVERSION. if you wanna alter the owner, you have to be able to SET ROLE to the new owning role, <em>and</em> that role has to have CREATE privilege on the conversion's schema. (these restrictions are there to enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the conversion. like, the rules exist so you can't sneak around the system, periodt.) BUT โ€” and this is the 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.
  • new_name โ€” the new name of the conversion. it's giving glow-up. ๐Ÿ’…
  • new_owner โ€” the new owner of the conversion.
  • new_schema โ€” the new schema for the conversion.

๐ŸŽ€ EXAMPLES ๐ŸŽ€

okay so say you wanna rename the conversion iso_8859_1_to_utf8 to latin1_to_unicode. iconic rebrand. do this:

ALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode;

and if you wanna change the owner of the conversion iso_8859_1_to_utf8 to joe? hand it over bestie:

ALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;

๐ŸŒˆ COMPATIBILITY ๐ŸŒˆ

ngl, there is no ALTER CONVERSION statement in the SQL standard. it's a PostgreSQL original. slay, i guess. ๐Ÿ’œ


๐Ÿ“ SEE ALSO ๐Ÿ“


k that's the whole page bestie, go forth and alter those conversions ๐Ÿ’–

this was PostgreSQL 18.6 docs, dated 2026. mwah. ๐Ÿ˜ญ๐Ÿซถ

๐Ÿ“ฆ where this page comes from