Skip to content

Commit ece2698

Browse files
committed
Remove collations from generic ALTER test
The error messages they generate are not portable enough. Also, since the only point of the alter_generic_1 expected file was to cover platforms with no collation support, it's now useless, so remove it.
1 parent 2ad881f commit ece2698

File tree

3 files changed

+10
-621
lines changed

3 files changed

+10
-621
lines changed

src/test/regress/expected/alter_generic.out

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -100,46 +100,9 @@ SELECT n.nspname, proname, prorettype::regtype, proisagg, a.rolname
100100
(8 rows)
101101

102102
--
103-
-- Collation
103+
-- We would test collations here, but it's not possible because the error
104+
-- messages tend to be nonportable.
104105
--
105-
SET SESSION AUTHORIZATION regtest_alter_user1;
106-
CREATE COLLATION alt_coll1 (locale = 'C');
107-
CREATE COLLATION alt_coll2 (locale = 'C');
108-
-- can't test this: the error message includes the encoding name
109-
-- ALTER COLLATION alt_coll1 RENAME TO alt_coll2; -- failed (name conflict)
110-
ALTER COLLATION alt_coll1 RENAME TO alt_coll3; -- OK
111-
ALTER COLLATION alt_coll2 OWNER TO regtest_alter_user2; -- failed (no role membership)
112-
ERROR: must be member of role "regtest_alter_user2"
113-
ALTER COLLATION alt_coll2 OWNER TO regtest_alter_user3; -- OK
114-
ALTER COLLATION alt_coll2 SET SCHEMA alt_nsp2; -- OK
115-
SET SESSION AUTHORIZATION regtest_alter_user2;
116-
CREATE COLLATION alt_coll1 (locale = 'C');
117-
CREATE COLLATION alt_coll2 (locale = 'C');
118-
ALTER COLLATION alt_coll3 RENAME TO alt_coll4; -- failed (not owner)
119-
ERROR: must be owner of collation alt_coll3
120-
ALTER COLLATION alt_coll1 RENAME TO alt_coll4; -- OK
121-
ALTER COLLATION alt_coll3 OWNER TO regtest_alter_user2; -- failed (not owner)
122-
ERROR: must be owner of collation alt_coll3
123-
ALTER COLLATION alt_coll2 OWNER TO regtest_alter_user3; -- failed (no role membership)
124-
ERROR: must be member of role "regtest_alter_user3"
125-
ALTER COLLATION alt_coll3 SET SCHEMA alt_nsp2; -- failed (not owner)
126-
ERROR: must be owner of collation alt_coll3
127-
-- can't test this: the error message includes the encoding name
128-
-- ALTER COLLATION alt_coll2 SET SCHEMA alt_nsp2; -- failed (name conflict)
129-
RESET SESSION AUTHORIZATION;
130-
SELECT n.nspname, c.collname, a.rolname
131-
FROM pg_collation c, pg_namespace n, pg_authid a
132-
WHERE c.collnamespace = n.oid AND c.collowner = a.oid
133-
AND n.nspname IN ('alt_nsp1', 'alt_nsp2')
134-
ORDER BY n.nspname, c.collname;
135-
nspname | collname | rolname
136-
----------+-----------+---------------------
137-
alt_nsp1 | alt_coll2 | regtest_alter_user2
138-
alt_nsp1 | alt_coll3 | regtest_alter_user1
139-
alt_nsp1 | alt_coll4 | regtest_alter_user2
140-
alt_nsp2 | alt_coll2 | regtest_alter_user3
141-
(4 rows)
142-
143106
--
144107
-- Conversion
145108
--
@@ -316,6 +279,7 @@ ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- fail
316279
ERROR: must be member of role "regtest_alter_user3"
317280
ALTER OPERATOR FAMILY alt_opf3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
318281
ERROR: must be owner of operator family alt_opf3
282+
-- can't test this: the error message includes the raw oid of namespace
319283
-- ALTER OPERATOR FAMILY alt_opf2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
320284
ALTER OPERATOR CLASS alt_opc3 USING hash RENAME TO alt_opc4; -- failed (not owner)
321285
ERROR: must be owner of operator class alt_opc3
@@ -326,6 +290,7 @@ ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- faile
326290
ERROR: must be member of role "regtest_alter_user3"
327291
ALTER OPERATOR CLASS alt_opc3 USING hash SET SCHEMA alt_nsp2; -- failed (not owner)
328292
ERROR: must be owner of operator class alt_opc3
293+
-- can't test this: the error message includes the raw oid of namespace
329294
-- ALTER OPERATOR CLASS alt_opc2 USING hash SET SCHEMA alt_nsp2; -- failed (name conflict)
330295
RESET SESSION AUTHORIZATION;
331296
SELECT nspname, opfname, amname, rolname
@@ -498,16 +463,13 @@ DROP LANGUAGE alt_lang3 CASCADE;
498463
DROP LANGUAGE alt_lang4 CASCADE;
499464
ERROR: language "alt_lang4" does not exist
500465
DROP SCHEMA alt_nsp1 CASCADE;
501-
NOTICE: drop cascades to 29 other objects
466+
NOTICE: drop cascades to 26 other objects
502467
DETAIL: drop cascades to function alt_func3(integer)
503468
drop cascades to function alt_agg3(integer)
504469
drop cascades to function alt_func4(integer)
505470
drop cascades to function alt_func2(integer)
506471
drop cascades to function alt_agg4(integer)
507472
drop cascades to function alt_agg2(integer)
508-
drop cascades to collation alt_coll3
509-
drop cascades to collation alt_coll4
510-
drop cascades to collation alt_coll2
511473
drop cascades to conversion alt_conv3
512474
drop cascades to conversion alt_conv4
513475
drop cascades to conversion alt_conv2
@@ -529,10 +491,9 @@ drop cascades to text search template alt_ts_temp2
529491
drop cascades to text search parser alt_ts_prs3
530492
drop cascades to text search parser alt_ts_prs2
531493
DROP SCHEMA alt_nsp2 CASCADE;
532-
NOTICE: drop cascades to 10 other objects
494+
NOTICE: drop cascades to 9 other objects
533495
DETAIL: drop cascades to function alt_nsp2.alt_func2(integer)
534496
drop cascades to function alt_nsp2.alt_agg2(integer)
535-
drop cascades to collation alt_coll2
536497
drop cascades to conversion alt_conv2
537498
drop cascades to operator alt_nsp2.@-@(integer,integer)
538499
drop cascades to operator family alt_nsp2.alt_opf2 for access method hash

0 commit comments

Comments
 (0)