ALTER_CONVERSION(7pg17)

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

πŸ’… ALTER_CONVERSION β€” change the definition of a conversion

okay so bestie, welcome to the ALTER CONVERSION page from the PostgreSQL 17.11 Documentation ✨ this one's short and sweet and honestly a little underrated. let's get into it 🫢


🌸 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 moods. pick one. slay πŸ’…


✨ DESCRIPTION ✨

ALTER CONVERSION changes the definition of a conversion. that's it, that's the whole vibe. iconic minimalism honestly πŸŽ€

but here's the thing β€” you must own the conversion to use ALTER CONVERSION. no ownership, no edits, periodt.

and if you wanna alter the owner? okay diva, extra steps unlocked πŸ”“ β€” you must be able to SET ROLE to the new owning role, and that role must have CREATE privilege on the conversion's schema. why, you ask? because these restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the conversion. like, no sneaky loopholes fr fr πŸ¦‹

πŸ’€ tiny caveat bestie: a superuser can alter ownership of any conversion anyway. main character energy, no rules apply 😭

πŸ¦‹ PARAMETERS πŸ¦‹

  • name β€” the name of an existing conversion (optionally schema-qualified, bc we love options ✨)
  • new_name β€” the new name of the conversion. glow-up name πŸ’–
  • new_owner β€” the new owner of the conversion. new boss, same conversion πŸ‘‘
  • new_schema β€” the new schema for the conversion. moving houses 🏠

🌈 EXAMPLES 🌈

okay so you want to rename the conversion iso_8859_1_to_utf8 to latin1_to_unicode? say less:

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 (hi joe πŸ‘‹), you do:

ALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;

ate. no notes. πŸ“


🧚 COMPATIBILITY 🧚

there is no ALTER CONVERSION statement in the SQL standard. like… at all. not a thing. PostgreSQL said "we'll do it ourselves" and honestly? valid πŸ’…


⭐ SEE ALSO ⭐


and that's the whole page bestie!! πŸ’œ this little beauty came from the PostgreSQL 17.11 Documentation, dated 2026, and it's giving "short manpage, big personality". mwah πŸŽ€πŸ’–πŸ«Ά

πŸ“¦ where this page comes from