]> granicus.if.org Git - postgresql/commitdiff
Fix some more regression test row-order-instability issues.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Jan 2017 22:32:37 +0000 (17:32 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Jan 2017 22:32:37 +0000 (17:32 -0500)
Commit 0563a3a8b just introduced another instance of the same unsafe
testing methodology that appeared in 2ac3ef7a0, which I corrected in
257d81572.  Robert/Amit, please stop doing that.

Also look through the rest of f0e44751d's test cases, and correct some
other queries with underdetermined ordering of results from the system
catalogs.  These haven't failed in the buildfarm yet, but I don't
have any confidence in that staying true.

Per multiple buildfarm members.

src/test/regress/expected/alter_table.out
src/test/regress/expected/create_table.out
src/test/regress/sql/alter_table.sql
src/test/regress/sql/create_table.sql

index b290bc810eb9a80eec50d58c36b3ff445dd756d4..c510761c68f07e54848b48f1494ca77c3cbbaf76 100644 (file)
@@ -3353,7 +3353,8 @@ from pg_attribute
 where attname = 'a'
  and (attrelid = 'p'::regclass
    or attrelid = 'p1'::regclass
-   or attrelid = 'p11'::regclass);
+   or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
  attrelid | attname | attnum 
 ----------+---------+--------
  p        | a       |      1
index 783602314cd5c61f208494d5d6ff12b5ef8e51d0..8a2818bf97fecf7cfae7e08f4ff1f72db5d15524 100644 (file)
@@ -400,7 +400,9 @@ SELECT relkind FROM pg_class WHERE relname = 'partitioned';
 (1 row)
 
 -- check that range partition key columns are marked NOT NULL
-SELECT attname, attnotnull FROM pg_attribute WHERE attrelid = 'partitioned'::regclass AND attnum > 0;
+SELECT attname, attnotnull FROM pg_attribute
+  WHERE attrelid = 'partitioned'::regclass AND attnum > 0
+  ORDER BY attnum;
  attname | attnotnull 
 ---------+------------
  a       | t
@@ -575,7 +577,9 @@ CREATE TABLE parted (
 ) PARTITION BY LIST (a);
 CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
 -- only inherited attributes (never local ones)
-SELECT attname, attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_a'::regclass and attnum > 0;
+SELECT attname, attislocal, attinhcount FROM pg_attribute
+  WHERE attrelid = 'part_a'::regclass and attnum > 0
+  ORDER BY attnum;
  attname | attislocal | attinhcount 
 ---------+------------+-------------
  a       | f          |           1
index 5d07e2ede44bc71b790fd82fbac576cfd3d4db26..86d27ac35ca9cd9a734f16d12d22c27b0faa7fa1 100644 (file)
@@ -2206,7 +2206,8 @@ from pg_attribute
 where attname = 'a'
  and (attrelid = 'p'::regclass
    or attrelid = 'p1'::regclass
-   or attrelid = 'p11'::regclass);
+   or attrelid = 'p11'::regclass)
+order by attrelid::regclass::text;
 
 alter table p1 attach partition p11 for values from (2) to (5);
 
index f1a67fddfa495141acecb919ca3dd9b4bb6b4d67..2ab652a055f04b76d5d918e4f0df615286123007 100644 (file)
@@ -403,7 +403,9 @@ CREATE TABLE partitioned (
 SELECT relkind FROM pg_class WHERE relname = 'partitioned';
 
 -- check that range partition key columns are marked NOT NULL
-SELECT attname, attnotnull FROM pg_attribute WHERE attrelid = 'partitioned'::regclass AND attnum > 0;
+SELECT attname, attnotnull FROM pg_attribute
+  WHERE attrelid = 'partitioned'::regclass AND attnum > 0
+  ORDER BY attnum;
 
 -- prevent a function referenced in partition key from being dropped
 DROP FUNCTION plusone(int);
@@ -548,7 +550,9 @@ CREATE TABLE parted (
 CREATE TABLE part_a PARTITION OF parted FOR VALUES IN ('a');
 
 -- only inherited attributes (never local ones)
-SELECT attname, attislocal, attinhcount FROM pg_attribute WHERE attrelid = 'part_a'::regclass and attnum > 0;
+SELECT attname, attislocal, attinhcount FROM pg_attribute
+  WHERE attrelid = 'part_a'::regclass and attnum > 0
+  ORDER BY attnum;
 
 -- able to specify column default, column constraint, and table constraint
 CREATE TABLE part_b PARTITION OF parted (