I wrote:
> Thomas Munro <[email protected]> writes:
>> I see that pg_upgrade is the real problem, but if that's somehow OK
>> ("v19 is a new port, dump and restore needed!") then I wonder if
>> -malign=natural (which seems to be the GCC equivalent of what the
>> native compiler called -qalign=natural) might be an option.
> Of course the $64 question is whether we can get away with requiring a
> dump and reload (and how we'd make pg_upgrade enforce that if we did,
> considering that existing installations' pg_control will only surface
> the value of MAXALIGN not DOUBLEALIGN).
Your thought of maybe applying some compiler ju-jitsu led me to a
different research direction: if we can get the compiler to lay out
the catalog structs as if DOUBLEALIGN and LONGALIGN were 4, then
problem solved without need for any user-table compatibility break.
And we can: it looks like inserting
#pragma pack(4)
before each catalog struct definition (and then "#pragma pack()"
afterwards to restore the normal rules) would do the trick.
This is probably quite gcc-specific, but if we're tossing xlc
overboard that doesn't matter.
Ideally we'd find a way to embed that in the CATALOG macros rather
than needing explicit AIX-droppings all over include/catalog/*.h.
But I'm not sure that it's possible to put a #pragma in a macro.
Even if we can't be neat about it, this is seeming like an attractive
line of inquiry.
regards, tom lane