{"Entry":{"collection":"sql","key":"alter-conversion","name":"ALTER CONVERSION","aliases":["alterconversion"],"metadata":{"aliases":["alterconversion"],"changed_in":["8.0","9.0","9.1","9.5","14"],"changes":[{"from":"7.3","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"7.4"},{"from":"7.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description","parameters","examples"],"removed":[]},"status":"changed","synopsis":{"added":["ALTER CONVERSION name OWNER TO newowner"],"removed":[]},"to":"8.0"},{"from":"8.0","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description","parameters","examples"],"removed":[]},"status":"changed","synopsis":null,"to":"8.1"},{"from":"8.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["ALTER CONVERSION name RENAME TO new_name","ALTER CONVERSION name OWNER TO new_owner"],"removed":["ALTER CONVERSION name RENAME TO newname","ALTER CONVERSION name OWNER TO newowner"]},"to":"9.0"},{"from":"9.0","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["ALTER CONVERSION name SET SCHEMA new_schema"],"removed":[]},"to":"9.1"},{"from":"9.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":{"added":["ALTER CONVERSION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }"],"removed":[]},"to":"9.5"},{"from":"13","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":{"added":["ALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }"],"removed":[]},"to":"14"},{"from":"15","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":null,"to":"16"}],"content_hash":"c15eecf9477951e341d38f61b3c6494f42c8491b83de8ac2eb31357016a34fff","editorial":{},"first_version":"7.4","group":"type","imported_at":"2026-09-30T17:43:37.430387+08:00","last_version":"20","name":"ALTER CONVERSION","object":"CONVERSION","position":3006,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"purpose":"change the definition of a conversion","purpose_zh":"","related":["create-conversion","drop-conversion"],"slug":"alter-conversion","source_rev":"a709ab85","synopsis":"ALTER CONVERSION name RENAME TO new_name\nALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION name SET SCHEMA new_schema","verb":"ALTER"}},"Definition":{"Collection":"sql","Key":"alter-conversion","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"alter-conversion","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-ALTERCONVERSION","file":"sql-alterconversion.html","lang":"en","name":"ALTER CONVERSION","purpose":"change the definition of a conversion","purpose_zh":"","related":["create-conversion","drop-conversion"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e changes the definition of a conversion.\u003c/p\u003e\u003cp\u003eYou must own the conversion to use \u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e. To alter the owner, you must be able to \u003ccode class=\"literal\"\u003eSET ROLE\u003c/code\u003e to the new owning role, and that role must have \u003ccode class=\"literal\"\u003eCREATE\u003c/code\u003e 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. However, a superuser can alter ownership of any conversion anyway.)\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of an existing conversion.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe new name of the conversion.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe new owner of the conversion.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_schema\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe new schema for the conversion.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eTo rename the conversion \u003ccode class=\"literal\"\u003eiso_8859_1_to_utf8\u003c/code\u003e to \u003ccode class=\"literal\"\u003elatin1_to_unicode\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode;\n\u003c/pre\u003e\u003cp\u003eTo change the owner of the conversion \u003ccode class=\"literal\"\u003eiso_8859_1_to_utf8\u003c/code\u003e to \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e statement in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-conversion/?v=18\" title=\"CREATE CONVERSION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE CONVERSION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-conversion/?v=18\" title=\"DROP CONVERSION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP CONVERSION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"ALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e RENAME TO \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\nALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e OWNER TO { \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET SCHEMA \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_schema\u003c/code\u003e\u003c/em\u003e","synopsis_text":"ALTER CONVERSION name RENAME TO new_name\nALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION name SET SCHEMA new_schema"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"alter-conversion","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ALTER CONVERSION","Summary":"更改一个转换的定义","BodyHTML":"\u003cpre\u003eALTER CONVERSION name RENAME TO new_name\nALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION name SET SCHEMA new_schema\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eALTER CONVERSION\u003c/code\u003e更改一个转换的定义。\u003c/p\u003e\u003cp\u003e要使用\u003ccode\u003eALTER CONVERSION\u003c/code\u003e，你必须拥有该转换。要更改拥有者，你必须能够对新的拥有者角色执行\u003ccode\u003eSET ROLE\u003c/code\u003e，并且该角色必须在转换所在模式上具有\u003ccode\u003eCREATE\u003c/code\u003e权限。（这些限制确保更改拥有者不会做出任何你无法通过删除并重新创建该转换来完成的事情。不过，超级用户仍然可以更改任何转换的所有权。）\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e一个现有转换的名称（可以是模式限定的）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新拥有者。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003enew_schema\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新模式。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e要把转换\u003ccode\u003eiso_8859_1_to_utf8\u003c/code\u003e重命名为\u003ccode\u003elatin1_to_unicode\u003c/code\u003e：\u003c/p\u003e\u003cpre\u003eALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode;\n\u003c/pre\u003e\u003cp\u003e要把转换\u003ccode\u003eiso_8859_1_to_utf8\u003c/code\u003e的拥有者改成\u003ccode\u003ejoe\u003c/code\u003e：\u003c/p\u003e\u003cpre\u003eALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e在 SQL 标准中没有\u003ccode\u003eALTER CONVERSION\u003c/code\u003e语句。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/create-conversion/?v=18\" title=\"CREATE CONVERSION\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE CONVERSION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-conversion/?v=18\" title=\"DROP CONVERSION\" rel=\"nofollow\"\u003e\u003cspan\u003eDROP CONVERSION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"1b5ca64c","ContentHash":"f448ef7b81f09df59d52d07afc4ea92efd2497242d4858383c96564d98c7a91b","Payload":{"purpose_zh":"更改一个转换的定义","sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e更改一个转换的定义。\u003c/p\u003e\u003cp\u003e要使用\u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e，你必须拥有该转换。要更改拥有者，你必须能够对新的拥有者角色执行\u003ccode class=\"literal\"\u003eSET ROLE\u003c/code\u003e，并且该角色必须在转换所在模式上具有\u003ccode class=\"literal\"\u003eCREATE\u003c/code\u003e权限。（这些限制确保更改拥有者不会做出任何你无法通过删除并重新创建该转换来完成的事情。不过，超级用户仍然可以更改任何转换的所有权。）\u003c/p\u003e","key":"description","title":"描述"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e一个现有转换的名称（可以是模式限定的）。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新拥有者。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_schema\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e转换的新模式。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"参数"},{"html":"\u003cp\u003e要把转换\u003ccode class=\"literal\"\u003eiso_8859_1_to_utf8\u003c/code\u003e重命名为\u003ccode class=\"literal\"\u003elatin1_to_unicode\u003c/code\u003e：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode;\n\u003c/pre\u003e\u003cp\u003e要把转换\u003ccode class=\"literal\"\u003eiso_8859_1_to_utf8\u003c/code\u003e的拥有者改成\u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe;\n\u003c/pre\u003e","key":"examples","title":"示例"},{"html":"\u003cp\u003e在 SQL 标准中没有\u003ccode class=\"command\"\u003eALTER CONVERSION\u003c/code\u003e语句。\u003c/p\u003e","key":"compatibility","title":"兼容性"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-conversion/?v=18\" title=\"CREATE CONVERSION\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE CONVERSION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-conversion/?v=18\" title=\"DROP CONVERSION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP CONVERSION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"另见"}],"sections_same_as":"","synopsis_html":"ALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e RENAME TO \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_name\u003c/code\u003e\u003c/em\u003e\nALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e OWNER TO { \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_owner\u003c/code\u003e\u003c/em\u003e | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e SET SCHEMA \u003cem class=\"replaceable\"\u003e\u003ccode\u003enew_schema\u003c/code\u003e\u003c/em\u003e","synopsis_text":"ALTER CONVERSION name RENAME TO new_name\nALTER CONVERSION name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }\nALTER CONVERSION name SET SCHEMA new_schema"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
