Movatterモバイル変換


[0]ホーム

URL:


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

Commitc1d59bd

Browse files
committed
fix problems with DELETE USING mentioned in issue #111
1 parent200a391 commitc1d59bd

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

‎expected/pathman_basic.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,20 @@ EXPLAIN (COSTS OFF) DELETE FROM test.range_rel r USING test.tmp t WHERE r.dt = '
17401740
(7 rows)
17411741

17421742
DELETE FROM test.range_rel r USING test.tmp t WHERE r.dt = '2010-01-02' AND r.id = t.id;
1743+
EXPLAIN (COSTS OFF) DELETE FROM test.tmp t USING test.range_rel r WHERE r.dt = '2010-01-02' AND r.id = t.id;
1744+
QUERY PLAN
1745+
--------------------------------------------------------------------------------------------------
1746+
Delete on tmp t
1747+
-> Hash Join
1748+
Hash Cond: (t.id = r.id)
1749+
-> Seq Scan on tmp t
1750+
-> Hash
1751+
-> Append
1752+
-> Index Scan using range_rel_1_pkey on range_rel_1 r
1753+
Filter: (dt = 'Sat Jan 02 00:00:00 2010'::timestamp without time zone)
1754+
(8 rows)
1755+
1756+
DELETE FROM test.tmp t USING test.range_rel r WHERE r.dt = '2010-01-02' AND r.id = t.id;
17431757
/* Create range partitions from whole range */
17441758
SELECT drop_partitions('test.range_rel');
17451759
NOTICE: 44 rows copied from test.range_rel_1

‎sql/pathman_basic.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ UPDATE test.range_rel r SET value = t.value FROM test.tmp t WHERE r.dt = '2010-0
527527
EXPLAIN (COSTS OFF)DELETEFROMtest.range_rel r USINGtest.tmp tWHEREr.dt='2010-01-02'ANDr.id=t.id;
528528
DELETEFROMtest.range_rel r USINGtest.tmp tWHEREr.dt='2010-01-02'ANDr.id=t.id;
529529

530+
EXPLAIN (COSTS OFF)DELETEFROMtest.tmp t USINGtest.range_rel rWHEREr.dt='2010-01-02'ANDr.id=t.id;
531+
DELETEFROMtest.tmp t USINGtest.range_rel rWHEREr.dt='2010-01-02'ANDr.id=t.id;
532+
530533

531534
/* Create range partitions from whole range*/
532535
SELECT drop_partitions('test.range_rel');

‎src/planner_tree_modification.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,6 @@ disable_standard_inheritance(Query *parse)
188188
ListCell*lc;
189189
Indexcurrent_rti;/* current range table entry index */
190190

191-
/*
192-
* We can't handle non-SELECT queries unless
193-
* there's a pathman_expand_inherited_rtentry_hook()
194-
*/
195-
#ifndefNATIVE_EXPAND_RTE_HOOK
196-
if (parse->commandType!=CMD_SELECT)
197-
return;
198-
#endif
199-
200191
/* Walk through RangeTblEntries list */
201192
current_rti=0;
202193
foreach (lc,parse->rtable)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp