ALTER_CONVERSION(7pg17)
π 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 β
CREATE CONVERSION(CREATE_CONVERSION(7)) β making conversions happen β¨DROP CONVERSION(DROP_CONVERSION(7)) β bye bye conversion π¦
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
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-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