Skip to content

Commit 6a700da

Browse files
committed
Fix unstable tests in partition_merge.sql and partition_split.sql.
The tests added by commit c086896 were unstable due to missing schema names when checking pg_tables and pg_indexes. Backpatch to v17. Reported by buildfarm.
1 parent 929390e commit 6a700da

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/test/regress/expected/partition_merge.out

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,21 +862,24 @@ SET search_path = partitions_merge_schema, pg_temp, public;
862862
ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
863863
ROLLBACK;
864864
-- Check the new partition inherits parent's tablespace
865+
SET search_path = partitions_merge_schema, public;
865866
CREATE TABLE t (i int PRIMARY KEY USING INDEX TABLESPACE regress_tblspace)
866867
PARTITION BY RANGE (i) TABLESPACE regress_tblspace;
867868
CREATE TABLE tp_0_1 PARTITION OF t FOR VALUES FROM (0) TO (1);
868869
CREATE TABLE tp_1_2 PARTITION OF t FOR VALUES FROM (1) TO (2);
869870
ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
870871
SELECT tablename, tablespace FROM pg_tables
871-
WHERE tablename IN ('t', 'tp_0_2') ORDER BY tablename, tablespace;
872+
WHERE tablename IN ('t', 'tp_0_2') AND schemaname = 'partitions_merge_schema'
873+
ORDER BY tablename, tablespace;
872874
tablename | tablespace
873875
-----------+------------------
874876
t | regress_tblspace
875877
tp_0_2 | regress_tblspace
876878
(2 rows)
877879

878880
SELECT tablename, indexname, tablespace FROM pg_indexes
879-
WHERE tablename IN ('t', 'tp_0_2') ORDER BY tablename, indexname, tablespace;
881+
WHERE tablename IN ('t', 'tp_0_2') AND schemaname = 'partitions_merge_schema'
882+
ORDER BY tablename, indexname, tablespace;
880883
tablename | indexname | tablespace
881884
-----------+-------------+------------------
882885
t | t_pkey | regress_tblspace

src/test/regress/expected/partition_split.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,8 @@ ALTER TABLE t SPLIT PARTITION tp_0_2 INTO
15021502
(PARTITION tp_0_1 FOR VALUES FROM (0) TO (1),
15031503
PARTITION tp_1_2 FOR VALUES FROM (1) TO (2));
15041504
SELECT tablename, tablespace FROM pg_tables
1505-
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') ORDER BY tablename, tablespace;
1505+
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') AND schemaname = 'partition_split_schema'
1506+
ORDER BY tablename, tablespace;
15061507
tablename | tablespace
15071508
-----------+------------------
15081509
t | regress_tblspace
@@ -1511,7 +1512,8 @@ SELECT tablename, tablespace FROM pg_tables
15111512
(3 rows)
15121513

15131514
SELECT tablename, indexname, tablespace FROM pg_indexes
1514-
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') ORDER BY tablename, indexname, tablespace;
1515+
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') AND schemaname = 'partition_split_schema'
1516+
ORDER BY tablename, indexname, tablespace;
15151517
tablename | indexname | tablespace
15161518
-----------+-------------+------------------
15171519
t | t_pkey | regress_tblspace

src/test/regress/sql/partition_merge.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,18 @@ ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
537537
ROLLBACK;
538538

539539
-- Check the new partition inherits parent's tablespace
540+
SET search_path = partitions_merge_schema, public;
540541
CREATE TABLE t (i int PRIMARY KEY USING INDEX TABLESPACE regress_tblspace)
541542
PARTITION BY RANGE (i) TABLESPACE regress_tblspace;
542543
CREATE TABLE tp_0_1 PARTITION OF t FOR VALUES FROM (0) TO (1);
543544
CREATE TABLE tp_1_2 PARTITION OF t FOR VALUES FROM (1) TO (2);
544545
ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
545546
SELECT tablename, tablespace FROM pg_tables
546-
WHERE tablename IN ('t', 'tp_0_2') ORDER BY tablename, tablespace;
547+
WHERE tablename IN ('t', 'tp_0_2') AND schemaname = 'partitions_merge_schema'
548+
ORDER BY tablename, tablespace;
547549
SELECT tablename, indexname, tablespace FROM pg_indexes
548-
WHERE tablename IN ('t', 'tp_0_2') ORDER BY tablename, indexname, tablespace;
550+
WHERE tablename IN ('t', 'tp_0_2') AND schemaname = 'partitions_merge_schema'
551+
ORDER BY tablename, indexname, tablespace;
549552
DROP TABLE t;
550553

551554
-- Check the new partition inherits parent's table access method

src/test/regress/sql/partition_split.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,11 @@ ALTER TABLE t SPLIT PARTITION tp_0_2 INTO
888888
(PARTITION tp_0_1 FOR VALUES FROM (0) TO (1),
889889
PARTITION tp_1_2 FOR VALUES FROM (1) TO (2));
890890
SELECT tablename, tablespace FROM pg_tables
891-
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') ORDER BY tablename, tablespace;
891+
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') AND schemaname = 'partition_split_schema'
892+
ORDER BY tablename, tablespace;
892893
SELECT tablename, indexname, tablespace FROM pg_indexes
893-
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') ORDER BY tablename, indexname, tablespace;
894+
WHERE tablename IN ('t', 'tp_0_1', 'tp_1_2') AND schemaname = 'partition_split_schema'
895+
ORDER BY tablename, indexname, tablespace;
894896
DROP TABLE t;
895897

896898
-- Check new partitions inherits parent's table access method

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy