Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1a56498

Browse files
committed
Make regression test output stable.
In the test query I added for ALTER TABLE retaining comments, the order of the result rows was not stable, and varied across systems. Add an ORDER BY to make the order predictable. This should fix the buildfarm failures.
1 parent e42375f commit 1a56498

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/regress/expected/alter_table.out

+6-6
Original file line numberDiff line numberDiff line change
@@ -2418,14 +2418,14 @@ SELECT col_description('comment_test'::regclass, 1) as comment;
24182418
Column 'id' on comment_test
24192419
(1 row)
24202420

2421-
SELECT indexrelid::regclass as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass;
2421+
SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
24222422
index | comment
24232423
--------------------+-----------------------------------------------
24242424
comment_test_index | Simple index on comment_test
24252425
comment_test_pk | Index backing the PRIMARY KEY of comment_test
24262426
(2 rows)
24272427

2428-
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass;
2428+
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
24292429
constraint | comment
24302430
---------------------------------+-----------------------------------------------
24312431
comment_test_pk | PRIMARY KEY constraint of comment_test
@@ -2449,18 +2449,18 @@ SELECT col_description('comment_test'::regclass, 1) as comment;
24492449
Column 'id' on comment_test
24502450
(1 row)
24512451

2452-
SELECT indexrelid::regclass as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass;
2452+
SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
24532453
index | comment
24542454
--------------------+-----------------------------------------------
2455-
comment_test_pk | Index backing the PRIMARY KEY of comment_test
24562455
comment_test_index | Simple index on comment_test
2456+
comment_test_pk | Index backing the PRIMARY KEY of comment_test
24572457
(2 rows)
24582458

2459-
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass;
2459+
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
24602460
constraint | comment
24612461
---------------------------------+-----------------------------------------------
2462-
comment_test_positive_col_check | CHECK constraint on comment_test.positive_col
24632462
comment_test_pk | PRIMARY KEY constraint of comment_test
2463+
comment_test_positive_col_check | CHECK constraint on comment_test.positive_col
24642464
(2 rows)
24652465

24662466
-- Check that we map relation oids to filenodes and back correctly. Only

src/test/regress/sql/alter_table.sql

+4-4
Original file line numberDiff line numberDiff line change
@@ -1610,8 +1610,8 @@ COMMENT ON CONSTRAINT comment_test_pk ON comment_test IS 'PRIMARY KEY constraint
16101610
COMMENT ON INDEX comment_test_pk IS 'Index backing the PRIMARY KEY of comment_test';
16111611

16121612
SELECT col_description('comment_test'::regclass, 1) as comment;
1613-
SELECT indexrelid::regclass as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass;
1614-
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass;
1613+
SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
1614+
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
16151615

16161616
-- Change the datatype of all the columns. ALTER TABLE is optimized to not
16171617
-- rebuild an index if the new data type is binary compatible with the old
@@ -1626,8 +1626,8 @@ ALTER TABLE comment_test ALTER COLUMN positive_col SET DATA TYPE bigint;
16261626

16271627
-- Check that the comments are intact.
16281628
SELECT col_description('comment_test'::regclass, 1) as comment;
1629-
SELECT indexrelid::regclass as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass;
1630-
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass;
1629+
SELECT indexrelid::regclass::text as index, obj_description(indexrelid, 'pg_class') as comment FROM pg_index where indrelid = 'comment_test'::regclass ORDER BY 1, 2;
1630+
SELECT conname as constraint, obj_description(oid, 'pg_constraint') as comment FROM pg_constraint where conrelid = 'comment_test'::regclass ORDER BY 1, 2;
16311631

16321632

16331633
-- Check that we map relation oids to filenodes and back correctly. Only

0 commit comments

Comments
 (0)