pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Concurrent REPACK: Clear out dropped-column values from all tupl
Date: Wed, 07 Oct 2026 08:57:50 +0000
Message-ID: <E1xENTC-00000000fRa-18Fw@gemulon.postgresql.org> (raw)

Concurrent REPACK: Clear out dropped-column values from all tuples

Commit e5d25959cf87 made REPACK null-out values of dropped columns in
the NEW tuple of an UPDATE.  However, a concurrent INSERT can carry one
too, for example when a trigger returns a copy of an existing row.
REPACK (CONCURRENTLY) then kept the values for such columns, which is
wasteful -- or worse, failed with "row is too big" if the new heap
happens not to have a TOAST table.

Move their clearing from prepare_concurrent_update() to restore_tuple()
so that it affects all tuples processed, not just the UPDATE ones.

Author: Shihao Zhong <zhong950419@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CAJgoLkK2UBzB1J9buCsSUbjf7bOqz-o_0=CeiTruU789BhBw-Q@mail.gmail.com

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/backend/commands/repack.c                      | 33 +++++++++++-----------
.../injection_points/expected/repack_dropped.out   |  8 ++++--
.../injection_points/specs/repack_dropped.spec     | 16 ++++++++++-
3 files changed, 37 insertions(+), 20 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1xENTC-00000000fRa-18Fw@gemulon.postgresql.org>
Permalink:  ../E1xENTC-00000000fRa-18Fw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xENTC-00000000fRa-18Fw@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: alvherre@kurilemu.de
  Subject: Re: pgsql: Concurrent REPACK: Clear out dropped-column values from all tupl
  In-Reply-To: <E1xENTC-00000000fRa-18Fw@gemulon.postgresql.org>
  References: <E1xENTC-00000000fRa-18Fw@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