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

Commite543fef

Browse files
committed
pathman: handle CTE subqueries
1 parentab50daa commite543fef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎contrib/pg_pathman/pg_pathman.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ PlannedStmt *
187187
pathman_planner_hook(Query*parse,intcursorOptions,ParamListInfoboundParams)
188188
{
189189
PlannedStmt*result;
190+
ListCell*lc;
190191

191192
if (initialization_needed)
192193
{
@@ -196,6 +197,15 @@ pathman_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams)
196197
inheritance_disabled= false;
197198
disable_inheritance(parse);
198199

200+
/* If query contains CTE (WITH statement) then handle subqueries too */
201+
foreach(lc,parse->cteList)
202+
{
203+
CommonTableExpr*cte= (CommonTableExpr*)lfirst(lc);
204+
205+
if (IsA(cte->ctequery,Query))
206+
disable_inheritance((Query*)cte->ctequery);
207+
}
208+
199209
/* Invoke original hook */
200210
if (planner_hook_original)
201211
result=planner_hook_original(parse,cursorOptions,boundParams);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp