Re: Database file compatability

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Database file compatability
Date: 2005-09-28 14:22:51
Message-ID: 6118.1127917371@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-28 15:09:45 Re: Proposed patch for sequence-renaming problems
Previous Message Tom Lane 2005-09-28 14:16:35 Re: enhanced pgbench