Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 26e9f96

Browse files
committed
Fix pathman_rebuild_deletes test for 11.
1 parent da30860 commit 26e9f96

File tree

3 files changed

+121
-3
lines changed

3 files changed

+121
-3
lines changed

‎expected/pathman_rebuild_deletes.out‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* -------------------------------------------
3+
* NOTE: This test behaves differenly on < 11 because planner now turns
4+
* Row(Const, Const) into just Const of record type, apparently since 3decd150
5+
* -------------------------------------------
6+
*/
17
\set VERBOSITY terse
28
SET search_path = 'public';
39
CREATE EXTENSION pg_pathman;
@@ -86,11 +92,11 @@ RETURNING t1.*, t1.tableoid::REGCLASS;
8692
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test
8793
WHERE val = 101 AND test >= (100, 8)
8894
RETURNING *, tableoid::REGCLASS;
89-
QUERY PLAN
90-
-----------------------------------------------------------------------------------
95+
QUERY PLAN
96+
-----------------------------------------------------------------------------------------
9197
Delete on test_11
9298
-> Seq Scan on test_11
93-
Filter: (((test_11.*)::test_deletes.test >= ROW(100, 8)) AND (val = 101))
99+
Filter: (((test_11.*)::test_deletes.test >= '(100,8)'::record) AND (val = 101))
94100
(3 rows)
95101

96102
DROP TABLE test_deletes.test_dummy;
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* -------------------------------------------
3+
* NOTE: This test behaves differenly on < 11 because planner now turns
4+
* Row(Const, Const) into just Const of record type, apparently since 3decd150
5+
* -------------------------------------------
6+
*/
7+
\set VERBOSITY terse
8+
SET search_path = 'public';
9+
CREATE EXTENSION pg_pathman;
10+
CREATE SCHEMA test_deletes;
11+
/*
12+
* Test DELETEs on a partition with different TupleDescriptor.
13+
*/
14+
/* create partitioned table */
15+
CREATE TABLE test_deletes.test(a FLOAT4, val INT4 NOT NULL, b FLOAT8);
16+
INSERT INTO test_deletes.test SELECT i, i, i FROM generate_series(1, 100) AS i;
17+
SELECT create_range_partitions('test_deletes.test', 'val', 1, 10);
18+
create_range_partitions
19+
-------------------------
20+
10
21+
(1 row)
22+
23+
/* drop column 'a' */
24+
ALTER TABLE test_deletes.test DROP COLUMN a;
25+
/* append new partition */
26+
SELECT append_range_partition('test_deletes.test');
27+
append_range_partition
28+
------------------------
29+
test_deletes.test_11
30+
(1 row)
31+
32+
INSERT INTO test_deletes.test_11 (val, b) VALUES (101, 10);
33+
VACUUM ANALYZE;
34+
/* tuple descs are the same */
35+
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test WHERE val = 1;
36+
QUERY PLAN
37+
---------------------------
38+
Delete on test_1
39+
-> Seq Scan on test_1
40+
Filter: (val = 1)
41+
(3 rows)
42+
43+
DELETE FROM test_deletes.test WHERE val = 1 RETURNING *, tableoid::REGCLASS;
44+
val | b | tableoid
45+
-----+---+---------------------
46+
1 | 1 | test_deletes.test_1
47+
(1 row)
48+
49+
/* tuple descs are different */
50+
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test WHERE val = 101;
51+
QUERY PLAN
52+
-----------------------------
53+
Delete on test_11
54+
-> Seq Scan on test_11
55+
Filter: (val = 101)
56+
(3 rows)
57+
58+
DELETE FROM test_deletes.test WHERE val = 101 RETURNING *, tableoid::REGCLASS;
59+
val | b | tableoid
60+
-----+----+----------------------
61+
101 | 10 | test_deletes.test_11
62+
(1 row)
63+
64+
CREATE TABLE test_deletes.test_dummy (val INT4);
65+
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test
66+
WHERE val = 101 AND val = ANY (TABLE test_deletes.test_dummy)
67+
RETURNING *, tableoid::REGCLASS;
68+
QUERY PLAN
69+
------------------------------------
70+
Delete on test_11
71+
-> Nested Loop Semi Join
72+
-> Seq Scan on test_11
73+
Filter: (val = 101)
74+
-> Seq Scan on test_dummy
75+
Filter: (val = 101)
76+
(6 rows)
77+
78+
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test t1
79+
USING test_deletes.test_dummy t2
80+
WHERE t1.val = 101 AND t1.val = t2.val
81+
RETURNING t1.*, t1.tableoid::REGCLASS;
82+
QUERY PLAN
83+
---------------------------------------
84+
Delete on test_11 t1
85+
-> Nested Loop
86+
-> Seq Scan on test_11 t1
87+
Filter: (val = 101)
88+
-> Seq Scan on test_dummy t2
89+
Filter: (val = 101)
90+
(6 rows)
91+
92+
EXPLAIN (COSTS OFF) DELETE FROM test_deletes.test
93+
WHERE val = 101 AND test >= (100, 8)
94+
RETURNING *, tableoid::REGCLASS;
95+
QUERY PLAN
96+
-----------------------------------------------------------------------------------
97+
Delete on test_11
98+
-> Seq Scan on test_11
99+
Filter: (((test_11.*)::test_deletes.test >= ROW(100, 8)) AND (val = 101))
100+
(3 rows)
101+
102+
DROP TABLE test_deletes.test_dummy;
103+
DROP SCHEMA test_deletes CASCADE;
104+
NOTICE: drop cascades to 13 other objects
105+
DROP EXTENSION pg_pathman;

‎sql/pathman_rebuild_deletes.sql‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* -------------------------------------------
3+
* NOTE: This test behaves differenly on < 11 because planner now turns
4+
* Row(Const, Const) into just Const of record type, apparently since 3decd150
5+
* -------------------------------------------
6+
*/
7+
18
\set VERBOSITY terse
29

310
SET search_path = 'public';

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /