1--
2-- create user defined conversion
3--
4CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
5SET SESSION AUTHORIZATION regress_conversion_user;
6CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
7--
8-- cannot make same name conversion in same schema
9--
10CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
11--
12-- create default conversion with qualified name
13--
14CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
15--
16-- cannot make default conversion with same schema/for_encoding/to_encoding
17--
18CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
19-- test comments
20COMMENT ON CONVERSION myconv_bad IS 'foo';
21COMMENT ON CONVERSION myconv IS 'bar';
22COMMENT ON CONVERSION myconv IS NULL;
23--
24-- drop user defined conversion
25--
26DROP CONVERSION myconv;
27DROP CONVERSION mydef;
28--
29-- Note: the built-in conversions are exercised in opr_sanity.sql,
30-- so there's no need to do that here.
31--
32--
33-- return to the super user
34--
35RESET SESSION AUTHORIZATION;
36DROP USER regress_conversion_user;
37