Re: Custom Type Alignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul Ramsey" <pramsey(at)cleverelephant(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Custom Type Alignment
Date: 2008-12-20 21:47:40
Message-ID: 22330.1229809660@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Paul Ramsey" <pramsey(at)cleverelephant(dot)ca> writes:
> Simple question on CREATE TYPE (I hope):
> When using the "alignment" option, and setting it to "double", what
> ends up double aligned? VARDATA()? The whole thing datum (so that the
> alignment of VARDATA() is actually conditioned on the size of
> VARHDRSZ) ?

No, the value as a whole. If you're talking about a varlena-format
value then the length word will start on a double boundary, and you'll
have to waste a word of alignment padding if the data payload has to
start on a double boundary.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Heift 2008-12-20 23:52:04 infinity interval
Previous Message Paul Ramsey 2008-12-20 21:12:11 Custom Type Alignment