Re: Decoupling our alignment assumptions about int64 and double

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Decoupling our alignment assumptions about int64 and double
Date: 2026-02-07 02:42:52
Message-ID: 2341948.1770432172@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v4-0001-Cope-with-AIX-s-alignment-woes-by-using-_Pragma-p.patch text/x-diff 15.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-02-07 04:31:43 Re: Row pattern recognition
Previous Message Euler Taveira 2026-02-07 01:05:28 Re: log_min_messages per backend type