Rebased.
I had started down a road where I was creating a number of new macros to
cover up more of the implementation details related to catalog tuple
updates. Then I felt that I was too far down the path and reverted to
the design in v1 with a simple layer that tracks what's been updated in
a Bitmapset and then passes that along to simple_heap_update() and then
to heapam_update(). This avoids the need to call
HeapDetermineColumnsInfo() inside heapam_update() when updating catalog
tuples. The rest of the calls to heapam_handle_update() still use
HeapDetermineColumnsInfo(), but if you look at my cf-5556 thread [1]
you'll see that I have fixed that side of the equation as well. cf-6221
and cf-5556 are two pieces of a puzzle.
0001 - adds macros to htup.h that cover the two models we have for
catalog tuple updates; Form/GETSTRUCT, and values/nulls/replaces. Also
included in this patch are a few of the more tricky cases as a way to
call them out.
0002 - the remaining files containing catalog tuple updates converted to
the use the new macros
0003 - a patch borrowed from cf-5556 that splits the top half of
heap_update() into heapam_handle_update() and simple_heap_update(). The
only change here vs in cf-5556 is that we pass on the updated bitmap
into heap_update().
thanks for your time and feedback,
best.
-greg
[1] https://commitfest.postgresql.org/patch/5556/