]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Don't lose column values on REPACK
authorÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 5 May 2026 08:24:49 +0000 (10:24 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 5 May 2026 08:24:49 +0000 (10:24 +0200)
commiteb2e2eb4d4cf31808f67a3f9cee77548308a4700
treebe5941efeeca881259fb2e76743dd8e03369bc73
parentd0eac3cafb0130b6da1eff03f2fd3afc448801c8
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 <satyanarlapuram@gmail.com>
Discussion: https://postgr.es/m/CAHg+QDeoccU5CudrJpmSKZfKZ1gRMNY=5BxSC=JpHgkonzgcOw@mail.gmail.com
contrib/test_decoding/expected/repack.out
contrib/test_decoding/sql/repack.sql
src/backend/access/heap/heapam_handler.c
src/test/regress/expected/fast_default.out
src/test/regress/sql/fast_default.sql