Re: pg_control contents

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_control contents
Дата
Msg-id 23147.1017081334@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_control contents  (Thomas Lockhart <thomas@fourpalms.org>)
Список pgsql-hackers
Thomas Lockhart <thomas@fourpalms.org> writes:
> If LOCALE_NAME_BUFLEN changes size between writing and reading the
> control file, the CRC *could* still be calculated correctly.

There might be some value to storing sizeof(ControlFileData) explicitly,
so that that CRC calculation could be made.  But I still see none in
storing LOCALE_NAME_BUFLEN explicitly.  There is *no* difference between
"I changed LOCALE_NAME_BUFLEN at random" and "I added or reordered
fields in the struct at random".  In either case the file has to be
treated as completely useless, because we don't really know what's in
there at what offset.  And making either sort of change without bumping
PG_CONTROL_VERSION is simply a mistake that we cannot afford to make.
There are plenty of places in PG where ill-considered hacking will have
undesirable consequences; pg_control is just one more.

The value of storing sizeof(ControlFileData) explicitly would not be
that we could hope to extract data safely, but only that we could
distinguish "corrupt data" from "good data in an incompatible format"
with marginally more reliability than now.  But both of these are and
must be failure cases, so it's really not that interesting to
distinguish between them.
        regards, tom lane


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: pg_control contents
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: views on temp tables