-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheudc.sql.in
30 lines (26 loc) · 1.61 KB
/
eudc.sql.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- SJIS_EUDC --> UTF8
CREATE FUNCTION pg_catalog.sjis_eudc_to_utf8 (integer, integer, cstring, internal, integer)
RETURNS void AS 'MODULE_PATHNAME', 'sjis_eudc_to_utf8' LANGUAGE C STRICT;
DROP CONVERSION pg_catalog.sjis_to_utf8;
CREATE DEFAULT CONVERSION pg_catalog.sjis_eudc_to_utf8 FOR 'SJIS' TO 'UTF8' FROM sjis_eudc_to_utf8;
-- UTF8 --> SJIS_EUDC
CREATE FUNCTION pg_catalog.utf8_to_sjis_eudc (integer, integer, cstring, internal, integer)
RETURNS void AS 'MODULE_PATHNAME', 'utf8_to_sjis_eudc' LANGUAGE C STRICT;
DROP CONVERSION pg_catalog.utf8_to_sjis;
CREATE DEFAULT CONVERSION pg_catalog.utf8_to_sjis_eudc FOR 'UTF8' TO 'SJIS' FROM utf8_to_sjis_eudc;
-- EUC_JP_EUDC --> UTF8
DROP CONVERSION pg_catalog.euc_jp_to_utf8;
CREATE FUNCTION pg_catalog.euc_jp_eudc_to_utf8 (integer, integer, cstring, internal, integer)
RETURNS void AS 'MODULE_PATHNAME', 'euc_jp_eudc_to_utf8' LANGUAGE C STRICT;
CREATE DEFAULT CONVERSION pg_catalog.euc_jp_eudc_to_utf8 FOR 'EUC_JP' TO 'UTF8' FROM euc_jp_eudc_to_utf8;
-- UTF8 --> EUC_JP_EUDC
CREATE FUNCTION pg_catalog.utf8_to_euc_jp_eudc (integer, integer, cstring, internal, integer)
RETURNS void AS 'MODULE_PATHNAME', 'utf8_to_euc_jp_eudc' LANGUAGE C STRICT;
DROP CONVERSION pg_catalog.utf8_to_euc_jp;
CREATE DEFAULT CONVERSION pg_catalog.utf8_to_euc_jp_eudc FOR 'UTF8' TO 'EUC_JP' FROM utf8_to_euc_jp_eudc;
-- To show eudc function information
CREATE OR REPLACE FUNCTION show_eudc(OUT "Conversion Function" varchar,
OUT "Source" varchar, OUT "Destination" varchar,
OUT "Is Default?" varchar)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'show_eudc' LANGUAGE C IMMUTABLE STRICT;