Re: database file compatibility patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: database file compatibility patch
Date: 2005-10-03 01:26:37
Message-ID: 10048.1128302797@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Qingqing Zhou 2005-10-03 02:05:42 Re: database file compatibility patch
Previous Message David Fetter 2005-10-02 23:52:56 Re: SQL/XML publishing function experimental patch II