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

Commitc6a01d9

Browse files
committed
Copy the INSERT query in postgres_fdw
When executing the INSERT with batching, we may need to rebuild thequery when the batch size changes, in which case we pfree the currentstring. We must not release the original string, stored in fdw_private,because that may be needed in EXPLAIN ANALYZE. So make copy of the SQL,but only for INSERT queries.Reported-by: Pavel StehuleDiscussion:https://postgr.es/m/CAFj8pRCL_Rjw-MCR6J7VX9OF7MR6PA5K8qUbrMvprW_e-aHkfQ%40mail.gmail.com
1 parent8292c06 commitc6a01d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,7 +3903,10 @@ create_foreign_modify(EState *estate,
39033903
/* Set up remote query information. */
39043904
fmstate->query=query;
39053905
if (operation==CMD_INSERT)
3906+
{
3907+
fmstate->query=pstrdup(fmstate->query);
39063908
fmstate->orig_query=pstrdup(fmstate->query);
3909+
}
39073910
fmstate->target_attrs=target_attrs;
39083911
fmstate->values_end=values_end;
39093912
fmstate->has_returning=has_returning;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp