pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Copy the INSERT query in postgres_fdw
Date: Fri, 07 May 2021 20:38:20 +0000
Message-ID: <E1lf7Eq-0005UT-2v@gemulon.postgresql.org> (raw)

Copy the INSERT query in postgres_fdw

When executing the INSERT with batching, we may need to rebuild the
query when the batch size changes, in which case we pfree the current
string. 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 Stehule
Discussion: https://postgr.es/m/CAFj8pRCL_Rjw-MCR6J7VX9OF7MR6PA5K8qUbrMvprW_e-aHkfQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c6a01d924939306e95c8deafd09352be6a955648

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 3 +++
1 file changed, 3 insertions(+)



Message-ID: <E1lf7Eq-0005UT-2v@gemulon.postgresql.org>
Permalink:  ../E1lf7Eq-0005UT-2v@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lf7Eq-0005UT-2v@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Copy the INSERT query in postgres_fdw
  In-Reply-To: <E1lf7Eq-0005UT-2v@gemulon.postgresql.org>
  References: <E1lf7Eq-0005UT-2v@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox