public inbox for [email protected]  
help / color / mirror / Atom feed
From: Álvaro Herrera <[email protected]>
To: [email protected]
Subject: pgsql: Don't lose column values on REPACK
Date: Tue, 05 May 2026 08:27:49 +0000
Message-ID: <[email protected]> (raw)

Don't lose column values on REPACK

Commit 28d534e2ae0a introduced reform_tuple() with a fast path that
returns the source tuple verbatim when no dropped columns require fixing
up.  I (Álvaro) failed to realize that this broke handling of columns
with a 'missingval' defined: after a VACUUM FULL, CLUSTER, or REPACK
operation, the catalogued missingval is thrown away, so the tuples are
no longer correct.

Fix by forcing the rewrite when the tuple is shorter than the tuple
descriptor.

Author: Satya Narlapuram <[email protected]>
Discussion: https://postgr.es/m/CAHg+QDeoccU5CudrJpmSKZfKZ1gRMNY=5BxSC=JpHgkonzgcOw@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
contrib/test_decoding/expected/repack.out  | 22 +++++++++++++++++
contrib/test_decoding/sql/repack.sql       |  9 +++++++
src/backend/access/heap/heapam_handler.c   | 38 +++++++++++++++++++++++-------
src/test/regress/expected/fast_default.out | 36 ++++++++++++++++++++++++++++
src/test/regress/sql/fast_default.sql      | 16 +++++++++++++
5 files changed, 112 insertions(+), 9 deletions(-)



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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Don't lose column values on REPACK
  In-Reply-To: <[email protected]>

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

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