2002-07-25 12:07:13 +02:00
|
|
|
--
|
|
|
|
-- create user defined conversion
|
|
|
|
--
|
2016-07-18 00:42:31 +02:00
|
|
|
CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
|
|
|
|
SET SESSION AUTHORIZATION regress_conversion_user;
|
2005-03-07 05:30:55 +01:00
|
|
|
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
|
2002-07-25 12:07:13 +02:00
|
|
|
--
|
|
|
|
-- cannot make same name conversion in same schema
|
|
|
|
--
|
2005-03-07 05:30:55 +01:00
|
|
|
CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
|
2002-07-25 12:07:13 +02:00
|
|
|
--
|
|
|
|
-- create default conversion with qualified name
|
|
|
|
--
|
2005-03-07 05:30:55 +01:00
|
|
|
CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
|
2002-07-25 12:07:13 +02:00
|
|
|
--
|
2016-01-05 22:43:40 +01:00
|
|
|
-- cannot make default conversion with same schema/for_encoding/to_encoding
|
2002-07-25 12:07:13 +02:00
|
|
|
--
|
2005-03-07 05:30:55 +01:00
|
|
|
CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
|
2003-11-21 23:32:49 +01:00
|
|
|
-- test comments
|
|
|
|
COMMENT ON CONVERSION myconv_bad IS 'foo';
|
|
|
|
COMMENT ON CONVERSION myconv IS 'bar';
|
|
|
|
COMMENT ON CONVERSION myconv IS NULL;
|
2002-07-25 12:07:13 +02:00
|
|
|
--
|
|
|
|
-- drop user defined conversion
|
|
|
|
--
|
|
|
|
DROP CONVERSION myconv;
|
|
|
|
DROP CONVERSION mydef;
|
|
|
|
--
|
2016-01-05 22:43:40 +01:00
|
|
|
-- Note: the built-in conversions are exercised in opr_sanity.sql,
|
|
|
|
-- so there's no need to do that here.
|
|
|
|
--
|
2002-08-06 07:40:47 +02:00
|
|
|
--
|
|
|
|
-- return to the super user
|
|
|
|
--
|
2002-07-25 12:07:13 +02:00
|
|
|
RESET SESSION AUTHORIZATION;
|
2016-07-18 00:42:31 +02:00
|
|
|
DROP USER regress_conversion_user;
|