Re: Decoupling our alignment assumptions about int64 and double
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2026-02-07T02:42:52Z
Lists: pgsql-hackers
Attachments
- v4-0001-Cope-with-AIX-s-alignment-woes-by-using-_Pragma-p.patch (text/x-diff) patch v4-0001
I wrote: > 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. Here's a POC patch to fix AIX's alignment problems that way. I feel much better about this approach than the other one ... regards, tom lane
Commits
-
Cope with AIX's alignment woes by using _Pragma("pack").
- ecae09725236 19 (unreleased) landed
-
Make some minor cleanups in typalign-related code.
- 7cdb633c89da 19 (unreleased) landed
-
Refactor att_align_nominal() to improve performance.
- da7a1dc0d62a 19 (unreleased) landed