Re: Database file compatability - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Database file compatability
Date
Msg-id 6118.1127917371@sss.pgh.pa.us
Whole thread Raw
In response to Re: Database file compatability  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Responses Re: Database file compatability
List pgsql-hackers
"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> wrote in message 
> There is a possible sequence like this:

> ALIGNOF_LONG        4
> ALIGNOF_DOUBLE      8
> MAXIMUM_ALIGNOF     8

> vs.

> ALIGNOF_LONG        8
> ALIGNOF_DOUBLE      8
> MAXIMUM_ALIGNOF     8

> So we should at least check ALIGNOF_LONG as well.

No, we don't need to, because we do not really care about ALIGNOF_LONG
per se.  We don't use "long" as an on-disk datatype, precisely because
we don't know what size it is.  We use int32 and int64.  The former has
align 4 on all machines AFAIK, and the latter has MAXIMUM_ALIGNOF.

> There are some machines with sizeof(int) equals to 64, if my memory saves, 
> which might imply that ALIGNOF_INT equals to 8.

If there were such a machine, Postgres wouldn't run on it anyway, and
a lot of other software too.  There'd be no way to have both int16 and
int32 types ("short" could cover only one of them).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: enhanced pgbench
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Proposed patch for sequence-renaming problems