Skip to content

Commit f33c53e

Browse files
committed
Revert "Hopefully-portable regression tests for CREATE/ALTER/DROP COLLATION."
This reverts commit 2636453. The buildfarm is sad.
1 parent 2636453 commit f33c53e

File tree

2 files changed

+0
-91
lines changed

2 files changed

+0
-91
lines changed

src/test/regress/expected/collate.out

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -626,51 +626,6 @@ SELECT collation for ((SELECT b FROM collate_test1 LIMIT 1));
626626
"C"
627627
(1 row)
628628

629-
-- CREATE COLLATE tests
630-
CREATE COLLATION collate_coll2 FROM "C";
631-
-- Ensure non-OWNER ROLEs are not able to ALTER/DROP COLLATION
632-
CREATE ROLE regress_rol_col1;
633-
GRANT USAGE ON SCHEMA collate_tests TO regress_rol_col1;
634-
SET ROLE regress_rol_col1;
635-
DROP COLLATION IF EXISTS collate_tests.collate_coll2;
636-
ERROR: must be owner of collation collate_tests.collate_coll2
637-
RESET ROLE;
638-
-- Ensure ALTER COLLATION SET SCHEMA works as expected
639-
CREATE SCHEMA collate_tests2;
640-
ALTER COLLATION collate_coll2 SET SCHEMA collate_tests2;
641-
DROP COLLATION collate_tests2.collate_coll2;
642-
DROP SCHEMA collate_tests2;
643-
-- Should work. Classic cases of CREATE/ALTER COLLATION
644-
CREATE COLLATION collate_coll3 (LOCALE = 'C');
645-
ALTER COLLATION collate_coll3 OWNER TO regress_rol_col1;
646-
ALTER COLLATION collate_coll3 RENAME TO collate_coll33;
647-
DROP COLLATION collate_coll33;
648-
-- Should fail. Give redundant options
649-
CREATE COLLATION collate_coll3a (LOCALE = 'C', LC_COLLATE = 'C', LC_CTYPE= 'C');
650-
ERROR: conflicting or redundant options
651-
-- Should fail. LC_COLLATE must be specified
652-
CREATE COLLATION collate_coll5 (LC_CTYPE= 'C');
653-
ERROR: parameter "lc_collate" must be specified
654-
-- Should fail. Give value options without value
655-
CREATE COLLATION collate_coll4a (LC_COLLATE = '');
656-
ERROR: parameter "lc_ctype" must be specified
657-
CREATE COLLATION collate_coll5a (LC_CTYPE= '');
658-
ERROR: parameter "lc_collate" must be specified
659-
-- Should fail. Give invalid option name
660-
CREATE COLLATION collate_coll6 (ASDF = 'C');
661-
ERROR: collation attribute "asdf" not recognized
662-
-- Ensure ROLEs without USAGE access can't CREATE/ALTER COLLATION
663-
CREATE SCHEMA collate_tests4;
664-
CREATE COLLATION collate_tests4.collate_coll9 (LOCALE = 'C');
665-
REVOKE USAGE ON SCHEMA collate_tests4 FROM regress_rol_col1;
666-
SET ROLE regress_rol_col1;
667-
ALTER COLLATION collate_tests4.collate_coll9 RENAME TO collate_coll9b;
668-
ERROR: permission denied for schema collate_tests4
669-
CREATE COLLATION collate_tests4.collate_coll10 (LOCALE = 'C');
670-
ERROR: permission denied for schema collate_tests4
671-
RESET ROLE;
672-
DROP SCHEMA collate_tests4 CASCADE;
673-
NOTICE: drop cascades to collation collate_coll9
674629
--
675630
-- Clean up. Many of these table names will be re-used if the user is
676631
-- trying to run any platform-specific collation tests later, so we
@@ -693,4 +648,3 @@ drop cascades to function dup(anyelement)
693648
drop cascades to table collate_test20
694649
drop cascades to table collate_test21
695650
drop cascades to table collate_test22
696-
DROP ROLE regress_rol_col1;

src/test/regress/sql/collate.sql

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -231,55 +231,10 @@ SELECT collation for ('foo'::text);
231231
SELECT collation for ((SELECT a FROM collate_test1 LIMIT 1)); -- non-collatable type - error
232232
SELECT collation for ((SELECT b FROM collate_test1 LIMIT 1));
233233

234-
-- CREATE COLLATE tests
235-
CREATE COLLATION collate_coll2 FROM "C";
236-
237-
-- Ensure non-OWNER ROLEs are not able to ALTER/DROP COLLATION
238-
CREATE ROLE regress_rol_col1;
239-
GRANT USAGE ON SCHEMA collate_tests TO regress_rol_col1;
240-
SET ROLE regress_rol_col1;
241-
DROP COLLATION IF EXISTS collate_tests.collate_coll2;
242-
RESET ROLE;
243-
244-
-- Ensure ALTER COLLATION SET SCHEMA works as expected
245-
CREATE SCHEMA collate_tests2;
246-
ALTER COLLATION collate_coll2 SET SCHEMA collate_tests2;
247-
DROP COLLATION collate_tests2.collate_coll2;
248-
DROP SCHEMA collate_tests2;
249-
250-
-- Should work. Classic cases of CREATE/ALTER COLLATION
251-
CREATE COLLATION collate_coll3 (LOCALE = 'C');
252-
ALTER COLLATION collate_coll3 OWNER TO regress_rol_col1;
253-
ALTER COLLATION collate_coll3 RENAME TO collate_coll33;
254-
DROP COLLATION collate_coll33;
255-
256-
-- Should fail. Give redundant options
257-
CREATE COLLATION collate_coll3a (LOCALE = 'C', LC_COLLATE = 'C', LC_CTYPE= 'C');
258-
259-
-- Should fail. LC_COLLATE must be specified
260-
CREATE COLLATION collate_coll5 (LC_CTYPE= 'C');
261-
262-
-- Should fail. Give value options without value
263-
CREATE COLLATION collate_coll4a (LC_COLLATE = '');
264-
CREATE COLLATION collate_coll5a (LC_CTYPE= '');
265-
266-
-- Should fail. Give invalid option name
267-
CREATE COLLATION collate_coll6 (ASDF = 'C');
268-
269-
-- Ensure ROLEs without USAGE access can't CREATE/ALTER COLLATION
270-
CREATE SCHEMA collate_tests4;
271-
CREATE COLLATION collate_tests4.collate_coll9 (LOCALE = 'C');
272-
REVOKE USAGE ON SCHEMA collate_tests4 FROM regress_rol_col1;
273-
SET ROLE regress_rol_col1;
274-
ALTER COLLATION collate_tests4.collate_coll9 RENAME TO collate_coll9b;
275-
CREATE COLLATION collate_tests4.collate_coll10 (LOCALE = 'C');
276-
RESET ROLE;
277-
DROP SCHEMA collate_tests4 CASCADE;
278234

279235
--
280236
-- Clean up. Many of these table names will be re-used if the user is
281237
-- trying to run any platform-specific collation tests later, so we
282238
-- must get rid of them.
283239
--
284240
DROP SCHEMA collate_tests CASCADE;
285-
DROP ROLE regress_rol_col1;

0 commit comments

Comments
 (0)