PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

CREATE CONVERSION

劉䓄

CREATE CONVERSION -- 垔幬婔婻桄䔇䔇䚡乕蘸扵

臺濘

CREATE [ DEFAULT ] CONVERSION name
    FOR source_encoding TO dest_encoding FROM funcname

柟誄

CREATE CONVERSION 垔幬庖严镖幋閘䔇蘸扵㔗蘸扵䔇劉庖埇傖䫘婘 convert 庘昄喙鄘弄滯䬹垔䔇䚡乕蘸扵㔗劯湙湺螄婺 DEFAULT 䔇蘸扵埇傖䫘庯婘嬉䆇启劯䆇幋閘䔇躻媘䚡乕蘸扵㔗庺庯認婻寘啹媙釂垔幬婴䓉蘸扵傯䚡乕 A 彄 B 傯䚡乕 B 彄 A 㔗

婺庖埇傖录傺蘸扵嘹媙釂婘庘昄婪橬 EXECUTE 溄鍊幽婫婘䕞湺昇嚟婪橬 CREATE 溄鍊㔗

埗昄

DEFAULT

DEFAULT 床埖臘䴺認䓉蘸扵滇傯認䓉溊䚡乕彄䕞湺䚡乕䔇䚺䩕蘸扵㔗劯婔婻昇嚟麯懟婔凹䚡乕庫臖埻橬婔婻䚺䩕䚡乕蘸扵㔗

name

蘸扵䔇劉庖㔗蘸扵劉埇傖䫘昇嚟媞閄㔗套悩澇橬闼幽蘸扵儌婘嘷嬉昇嚟婺垔幬㔗蘸扵劉婘婔婻昇嚟麯媙釂嫇婔㔗

source_encoding

溊䚡乕劉

dest_encoding

䕞湺䚡乕劉

funcname

䫘庯欓臯蘸扵䔇庘昄㔗認婻庘昄劉埇傖䫘昇嚟劉媞閄㔗套悩澇橬闼幽儖傯虇冇婺欆庺認婻庘昄㔗

溴庘昄媙釂橬套婋䔇湙床

conv_proc(
    integer,  -- 溊䚡乕 ID
    integer,  -- 䕞䔇䚡乕 ID
    cstring,  -- 溊庖严婾(䷺䂷儆䔇 C 庖严婾)
    internal, -- 䕞䔇庖严婾(䫘䷺䂷儆䔇C庖严婾准噙)
    integer   -- 溊庖严婾阪庥
) RETURNS void;

濘懟

DROP CONVERSION 役鍴䫘潙垔幬䔇蘸扵㔗

录傺蘸扵欔驔襕䔇溄鍊埇脘婘橻準䔇䬽橸婺櫹埻㔗

冋床

myfunc 录傺婔婻傯 UTF8 䚡乕彄 LATIN1 䚡乕䔇蘸扵

CREATE CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc;

噚垹攓

CREATE CONVERSION 滇 PostgreSQL 䔇欷匘㔗婘 SQL 湺庖麯澇橬 CREATE CONVERSION 臺埖㔗

埽蓕

ALTER CONVERSION, CREATE FUNCTION, DROP CONVERSION

劯锔饡釕嬉誕
CREATE CONSTRAINT TRIGGER婪婔亓CREATE DATABASE