ALTER_CONVERSION(7pg16)
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 π
CREATE CONVERSION(CREATE_CONVERSION(7))DROP CONVERSION(DROP_CONVERSION(7))
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
- 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