Re: Database file compatability - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Database file compatability
Date
Msg-id 20050930231435.GO40138@pervasive.com
Whole thread Raw
In response to Re: Database file compatability  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Sep 28, 2005 at 10:22:51AM -0400, Tom Lane wrote:
> "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.

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@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: State of support for back PG branches
Next
From: "Jim C. Nasby"
Date:
Subject: Re: PostgreSQL overall design