From 189d0ff588f54b9641c6684d7c668ef85ea4dfbd Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 19 Jan 2018 12:31:34 -0300 Subject: [PATCH] Fix regression tests for better stability Per buildfarm --- src/test/regress/expected/indexing.out | 26 +++++++++++++------------- src/test/regress/sql/indexing.sql | 10 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/regress/expected/indexing.out b/src/test/regress/expected/indexing.out index e9cccca876..ffd4b10c37 100644 --- a/src/test/regress/expected/indexing.out +++ b/src/test/regress/expected/indexing.out @@ -224,26 +224,26 @@ Partition of: idxpart2 FOR VALUES FROM (100) TO (200) select indexrelid::regclass, indrelid::regclass, inhparent::regclass from pg_index idx left join pg_inherits inh on (idx.indexrelid = inh.inhrelid) where indexrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; indexrelid | indrelid | inhparent -----------------+-----------+--------------- - idxpart_a_idx | idxpart | idxpart1_a_idx | idxpart1 | idxpart_a_idx - idxpart2_a_idx | idxpart2 | idxpart_a_idx idxpart22_a_idx | idxpart22 | + idxpart2_a_idx | idxpart2 | idxpart_a_idx + idxpart_a_idx | idxpart | (4 rows) alter index idxpart2_a_idx attach partition idxpart22_a_idx; select indexrelid::regclass, indrelid::regclass, inhparent::regclass from pg_index idx left join pg_inherits inh on (idx.indexrelid = inh.inhrelid) where indexrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; indexrelid | indrelid | inhparent -----------------+-----------+---------------- - idxpart_a_idx | idxpart | idxpart1_a_idx | idxpart1 | idxpart_a_idx - idxpart2_a_idx | idxpart2 | idxpart_a_idx idxpart22_a_idx | idxpart22 | idxpart2_a_idx + idxpart2_a_idx | idxpart2 | idxpart_a_idx + idxpart_a_idx | idxpart | (4 rows) -- attaching idxpart22 is not enough to set idxpart22_a_idx valid ... @@ -600,15 +600,15 @@ alter table idxpart attach partition idxpart2 for values from (10) to (20); select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; relname | pg_get_indexdef ------------------+-------------------------------------------------------------- - idxparti | CREATE INDEX idxparti ON ONLY idxpart USING btree (a) - idxparti2 | CREATE INDEX idxparti2 ON ONLY idxpart USING btree (c, b) idxpart1_a_idx | CREATE INDEX idxpart1_a_idx ON idxpart1 USING btree (a) idxpart1_c_b_idx | CREATE INDEX idxpart1_c_b_idx ON idxpart1 USING btree (c, b) idxpart2_a_idx | CREATE INDEX idxpart2_a_idx ON idxpart2 USING btree (a) idxpart2_c_b_idx | CREATE INDEX idxpart2_c_b_idx ON idxpart2 USING btree (c, b) + idxparti | CREATE INDEX idxparti ON ONLY idxpart USING btree (a) + idxparti2 | CREATE INDEX idxparti2 ON ONLY idxpart USING btree (c, b) (6 rows) drop table idxpart; @@ -626,12 +626,12 @@ alter table idxpart attach partition idxpart1 for values from (1) to (2); select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; relname | pg_get_indexdef ------------------+------------------------------------------------------------------- - idxpart_abs_idx | CREATE INDEX idxpart_abs_idx ON ONLY idxpart USING btree (abs(b)) idxpart1_abs_idx | CREATE INDEX idxpart1_abs_idx ON idxpart1 USING btree (abs(b)) idxpart2_abs_idx | CREATE INDEX idxpart2_abs_idx ON idxpart2 USING btree (abs(b)) + idxpart_abs_idx | CREATE INDEX idxpart_abs_idx ON ONLY idxpart USING btree (abs(b)) (3 rows) drop table idxpart; @@ -649,12 +649,12 @@ create index on idxpart (a) where b > 1000; select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; relname | pg_get_indexdef ----------------+----------------------------------------------------------------------------- - idxpart_a_idx | CREATE INDEX idxpart_a_idx ON ONLY idxpart USING btree (a) WHERE (b > 1000) idxpart1_a_idx | CREATE INDEX idxpart1_a_idx ON idxpart1 USING btree (a) WHERE (b > 1000) idxpart2_a_idx | CREATE INDEX idxpart2_a_idx ON idxpart2 USING btree (a) WHERE (b > 1000) + idxpart_a_idx | CREATE INDEX idxpart_a_idx ON ONLY idxpart USING btree (a) WHERE (b > 1000) (3 rows) drop table idxpart; diff --git a/src/test/regress/sql/indexing.sql b/src/test/regress/sql/indexing.sql index 33be718699..2f985ec866 100644 --- a/src/test/regress/sql/indexing.sql +++ b/src/test/regress/sql/indexing.sql @@ -116,12 +116,12 @@ create index on idxpart (a); select indexrelid::regclass, indrelid::regclass, inhparent::regclass from pg_index idx left join pg_inherits inh on (idx.indexrelid = inh.inhrelid) where indexrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; alter index idxpart2_a_idx attach partition idxpart22_a_idx; select indexrelid::regclass, indrelid::regclass, inhparent::regclass from pg_index idx left join pg_inherits inh on (idx.indexrelid = inh.inhrelid) where indexrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; -- attaching idxpart22 is not enough to set idxpart22_a_idx valid ... alter index idxpart2_a_idx attach partition idxpart22_a_idx; \d idxpart2 @@ -306,7 +306,7 @@ alter table idxpart attach partition idxpart2 for values from (10) to (20); select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; drop table idxpart; -- Verify that columns are mapped correctly in expression indexes @@ -323,7 +323,7 @@ alter table idxpart attach partition idxpart1 for values from (1) to (2); select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; drop table idxpart; -- Verify that columns are mapped correctly for WHERE in a partial index @@ -340,7 +340,7 @@ create index on idxpart (a) where b > 1000; select c.relname, pg_get_indexdef(indexrelid) from pg_class c join pg_index i on c.oid = i.indexrelid where indrelid::regclass::text like 'idxpart%' - order by indrelid::regclass::text collate "C"; + order by indexrelid::regclass::text collate "C"; drop table idxpart; -- Column number mapping: dropped columns in the partition -- 2.40.0