Re: database file compatibility patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: database file compatibility patch
Date
Msg-id 10048.1128302797@sss.pgh.pa.us
Whole thread Raw
In response to database file compatibility patch  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
Responses Re: database file compatibility patch
List pgsql-patches
Qingqing Zhou <zhouqq@cs.toronto.edu> writes:
> This patches checks MAXIMUM_ALIGNOF and endian to make sure that the
> database file used is compatible with the server version.

I missed seeing this patch in my inbox, so wrote and applied my own
version earlier today.  Sorry for the missed communication :-(.  It's
about the same result though.

> What it comes down
> to is that MAXIMUM_ALIGNOF is sufficient to tell the difference between
> the platforms we need to deal with. Also, check the endian to make sure
> that the multibytes numbers storage is compatible.

There's not much need to check endianness explicitly, since the
pg_control_version check will surely fail if there's an endianness
discrepancy (not to mention the other checks on pg_control fields).
[ Actually, I had originally thought that alignment would be reflected
implicitly in pg_control too, but given that it's mostly int32 fields
I don't think that can be relied on. ]

What I did add, after reviewing the past discussion of these issues,
is a simple-minded test to see if the floating-point storage format
is the same.  That and endianness/alignment are the only points that
have been mentioned as likely causes of cross-platform incompatibility.

            regards, tom lane

pgsql-patches by date:

Previous
From: David Fetter
Date:
Subject: Re: SQL/XML publishing function experimental patch II
Next
From: Qingqing Zhou
Date:
Subject: Re: database file compatibility patch