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: Fix tuple routing to initialize batching only for inserts
Date: Wed, 17 Feb 2021 23:27:53 +0000
Message-ID: <E1lCWEb-0001KF-7O@gemulon.postgresql.org> (raw)

Fix tuple routing to initialize batching only for inserts

A cross-partition update on a partitioned table is implemented as a
delete followed by an insert. With foreign partitions, this was however
causing issues, because the FDW and core may disagree on when to enable
batching.  postgres_fdw was only allowing batching for plain inserts
(CMD_INSERT) while core was trying to batch the insert component of the
cross-partition update.  Fix by restricting core to apply batching only
to plain CMD_INSERT queries.

It's possible to allow batching for cross-partition updates, but that
will require more extensive changes, so better to leave that for a
separate patch.

Author: Amit Langote
Reviewed-by: Tomas Vondra, Takayuki Tsunakawa
Discussion: https://postgr.es/m/20200628151002.7x5laxwpgvkyiu3q@development

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/927f453a941061e3d5884bab206581c34784e45b

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 23 ++++++++++++++++++++++-
contrib/postgres_fdw/postgres_fdw.c            | 13 +++++++++++--
contrib/postgres_fdw/sql/postgres_fdw.sql      | 19 ++++++++++++++++++-
src/backend/executor/execPartition.c           |  3 ++-
4 files changed, 53 insertions(+), 5 deletions(-)



Message-ID: <E1lCWEb-0001KF-7O@gemulon.postgresql.org>
Permalink:  ../E1lCWEb-0001KF-7O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lCWEb-0001KF-7O@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: Fix tuple routing to initialize batching only for inserts
  In-Reply-To: <E1lCWEb-0001KF-7O@gemulon.postgresql.org>
  References: <E1lCWEb-0001KF-7O@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