Problem with ControlFileData structure being ABI dependent

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Problem with ControlFileData structure being ABI dependent
Дата
Msg-id 877ijrx5vl.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответы Re: Problem with ControlFileData structure being ABI dependent  (Dave Page <dpage@postgresql.org>)
Список pgsql-hackers
In trying to run a benchmark comparing mingw with VC++ builds Dave discovered
that if you initdb with one and try to run with the other you get a message
saying "incorrect checksum in control file" rather than the more appropriate
and friendly "database files are incompatible with server".

This is because of (at least) two changes in the ABI between the runtimes used
by mingw and VC++. 1) Enums are apparently 8 bytes on VC++ but 4 bytes on
mingw and 2) time_t is 8 bytes on VC++ but 4 bytes on mingw.

To get the right message we could add the size of the control file (or
offsetof(crc)) to the control file itself near the top and check it before the
checksum. That would be an initdb though which would be annoying at this
point. I think we should do this at the next opportunity though.

But I'm a bit concerned about change in ABI between mingw and VC++. I thought
these two used the same ABI. Are we sure Slony et al don't use time_t or enums
or anything else which may have changed between these two runtimes?

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Manolo _
Дата:
Сообщение: Compiling PG on linux
Следующее
От: Dave Page
Дата:
Сообщение: Re: Problem with ControlFileData structure being ABI dependent