Re: POC: postgres_fdw insert batching - Mailing list pgsql-hackers

From Amit Langote
Subject Re: POC: postgres_fdw insert batching
Date
Msg-id CA+HiwqGjMVLEn8JoNT+XCeXA9SFECVvTEMawbzJ-RN_M+fxMTw@mail.gmail.com
Whole thread Raw
In response to RE: POC: postgres_fdw insert batching  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Responses RE: POC: postgres_fdw insert batching  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Re: POC: postgres_fdw insert batching  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers
Tsunakwa-san,

On Mon, Jan 25, 2021 at 1:21 PM tsunakawa.takay@fujitsu.com
<tsunakawa.takay@fujitsu.com> wrote:
> From: Amit Langote <amitlangote09@gmail.com>
> > Yes, it can be simplified by using a local join to prevent the update of the foreign
> > partition from being pushed to the remote server, for which my example in the
> > previous email used a local trigger.  Note that the update of the foreign
> > partition to be done locally is a prerequisite for this bug to occur.
>
> Thank you, I was aware that UPDATE calls ExecInsert() but forgot about it partway.  Good catch (and my bad miss.)

It appears I had missed your reply, sorry.

> +       PgFdwModifyState *fmstate = resultRelInfo->ri_FdwState ?
> +                                                       (PgFdwModifyState *) resultRelInfo->ri_FdwState :
> +                                                       NULL;
>
> This can be written as:
>
> +       PgFdwModifyState *fmstate = (PgFdwModifyState *) resultRelInfo->ri_FdwState;

Facepalm, yes.

Patch updated.  Thanks for the review.

-- 
Amit Langote
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: psql tab completion for CREATE DATABASE ... LOCALE
Next
From: "Huang, Qiuyan"
Date:
Subject: RE: Determine parallel-safety of partition relations for Inserts