pgsql: Clear out values from dropped columns during REPACK (CONCURRENTL

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Clear out values from dropped columns during REPACK (CONCURRENTL
Date: 2026-10-03 11:07:09
Message-ID: E1xCxa9-000000008xw-3USo@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clear out values from dropped columns during REPACK (CONCURRENTLY)

When repacking a table concurrently, some border conditions can cause
a concurrent update to propagate the original old tuple to the transient
table (such as a trigger that returns OLD). That's essentially just
wasted space, which REPACK is there to remove. Prevent that by setting
the isnull flag to true for any column cataloged as dropped in tuples
being "replayed" as concurrent updates.

Reported-by: Radim Marek <radim(at)boringsql(dot)com>
Reviewed-by: Antonin Houska <ah(at)cybertec(dot)at>
Backpatch: 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/10c67bcb2da6acb16ce77ff1a498532b26538dcc

Modified Files
--------------
src/backend/commands/repack.c | 36 +++++++----
.../injection_points/expected/repack_dropped.out | 47 ++++++++++++++
src/test/modules/injection_points/meson.build | 1 +
.../injection_points/specs/repack_dropped.spec | 71 ++++++++++++++++++++++
4 files changed, 144 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-10-03 18:45:02 pgsql: Fix lcov duplicate directory specification in non-VPATH builds.
Previous Message Amit Langote 2026-10-03 02:46:15 pgsql: Remove batching from RI fast-path checks