Don't lose column values on REPACK
Álvaro Herrera <alvherre@kurilemu.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/test_decoding/expected/repack.out | modified | +22 −0 |
| contrib/test_decoding/sql/repack.sql | modified | +9 −0 |
| src/backend/access/heap/heapam_handler.c | modified | +29 −9 |
| src/test/regress/expected/fast_default.out | modified | +36 −0 |
| src/test/regress/sql/fast_default.sql | modified | +16 −0 |
Discussion
- [Bug]Vacuum full silently NULL out fast default columns 6 messages · 2026-05-04 → 2026-05-05