summaryrefslogtreecommitdiffstats
path: root/src/test/regress/sql/conversion.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/conversion.sql')
-rw-r--r--src/test/regress/sql/conversion.sql36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/regress/sql/conversion.sql b/src/test/regress/sql/conversion.sql
new file mode 100644
index 0000000..02cf39f
--- /dev/null
+++ b/src/test/regress/sql/conversion.sql
@@ -0,0 +1,36 @@
+--
+-- create user defined conversion
+--
+CREATE USER regress_conversion_user WITH NOCREATEDB NOCREATEROLE;
+SET SESSION AUTHORIZATION regress_conversion_user;
+CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
+--
+-- cannot make same name conversion in same schema
+--
+CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
+--
+-- create default conversion with qualified name
+--
+CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
+--
+-- cannot make default conversion with same schema/for_encoding/to_encoding
+--
+CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8;
+-- test comments
+COMMENT ON CONVERSION myconv_bad IS 'foo';
+COMMENT ON CONVERSION myconv IS 'bar';
+COMMENT ON CONVERSION myconv IS NULL;
+--
+-- drop user defined conversion
+--
+DROP CONVERSION myconv;
+DROP CONVERSION mydef;
+--
+-- Note: the built-in conversions are exercised in opr_sanity.sql,
+-- so there's no need to do that here.
+--
+--
+-- return to the super user
+--
+RESET SESSION AUTHORIZATION;
+DROP USER regress_conversion_user;