Re: documentation inconsistent re: alignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: documentation inconsistent re: alignment
Date: 2019-10-20 18:47:57
Message-ID: 10248.1571597277@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chapman Flack <chap(at)anastigmatix(dot)net> writes:
> The documentation for CREATE TYPE has this to say about alignment:

> "The alignment parameter specifies the storage alignment required for the
> data type. The allowed values equate to alignment on 1, 2, 4, or 8 byte
> boundaries."

> ... while the documentation for pg_type has:

> "c = char alignment, i.e., no alignment needed.
> s = short alignment (2 bytes on most machines).
> i = int alignment (4 bytes on most machines).
> d = double alignment (8 bytes on many machines, but by no means all)."

> so, in 2019, are the alignments weaselly and variable, or are they 1,2,4,8?

Probably the statement in CREATE TYPE is too strong. There are, I
believe, still machines in the buildfarm where maxalign is just 4.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2019-10-20 19:31:06 Re: configure fails for perl check on CentOS8
Previous Message vignesh C 2019-10-20 17:32:31 Re: Ordering of header file inclusion