2
-- create user defined conversion
4
CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER;
5
SET SESSION AUTHORIZATION conversion_test_user;
6
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8;
8
-- cannot make same name conversion in same schema
10
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8;
12
-- create default conversion with qualified name
14
CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8;
16
-- cannot make default conversion with same shcema/for_encoding/to_encoding
18
CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8;
20
-- drop user defined conversion
22
DROP CONVERSION myconv;
23
DROP CONVERSION mydef;
25
-- make sure all pre-defined conversions are fine.