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 <[email protected]>
Reviewed-by: Antonin Houska <[email protected]>
Backpatch: 19
Discussion: 
https://postgr.es/m/CAJgoLkK2UBzB1J9buCsSUbjf7bOqz-o_0=ceitruu789bhb...@mail.gmail.com

Branch
------
master

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

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(-)

Reply via email to