pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow using the updated tuple while moving it to a different par
Date: Thu, 12 Jul 2018 07:33:54 +0000
Message-ID: <E1fdW6s-00054L-QI@gemulon.postgresql.org> (raw)

Allow using the updated tuple while moving it to a different partition.

An update that causes the tuple to be moved to a different partition was
missing out on re-constructing the to-be-updated tuple, based on the latest
tuple in the update chain.  Instead, it's simply deleting the latest tuple
and inserting a new tuple in the new partition based on the old tuple.
Commit 2f17844104 didn't consider this case, so some of the updates were
getting lost.

In passing, change the argument order for output parameter in ExecDelete
and add some commentary about it.

Reported-by: Pavan Deolasee
Author: Amit Khandekar, with minor changes by me
Reviewed-by: Dilip Kumar, Amit Kapila and Alvaro Herrera
Backpatch-through: 11
Discussion: https://postgr.es/m/CAJ3gD9fRbEzDqdeDq1jxqZUb47kJn+tQ7=Bcgjc8quqKsDViKQ@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0527df732beb8c2d584c7e4ea5aeb05cf92e14a2

Modified Files
--------------
src/backend/commands/trigger.c                     | 22 ++++++-
src/backend/executor/execReplication.c             |  2 +-
src/backend/executor/nodeModifyTable.c             | 73 +++++++++++++++------
src/include/commands/trigger.h                     |  3 +-
.../isolation/expected/partition-key-update-4.out  | 60 +++++++++++++++++
src/test/isolation/isolation_schedule              |  1 +
.../isolation/specs/partition-key-update-4.spec    | 76 ++++++++++++++++++++++
7 files changed, 214 insertions(+), 23 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1fdW6s-00054L-QI@gemulon.postgresql.org>
Permalink:  ../E1fdW6s-00054L-QI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fdW6s-00054L-QI@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow using the updated tuple while moving it to a different par
  In-Reply-To: <E1fdW6s-00054L-QI@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