Re: Database file compatability

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Database file compatability
Date: 2005-09-30 23:14:35
Message-ID: 20050930231435.GO40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 28, 2005 at 10:22:51AM -0400, Tom Lane wrote:
> "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.

Is there a serious penalty associated with just checking them all? Seems
like better safe than sorry...

On a related note, are checks for endianness made as well?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-09-30 23:19:08 Re: PostgreSQL overall design
Previous Message Jim C. Nasby 2005-09-30 23:12:05 Re: State of support for back PG branches