offline consistency check and info on attributes

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема offline consistency check and info on attributes
Дата
Msg-id 4DB4549B.3060109@fuzzy.cz
обсуждение исходный текст
Ответы Re: offline consistency check and info on attributes  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Hi,

a recent discussion about possible data corruption (in the general list)
suggests that a tool for offline integrity check might be useful.
Something that might be run when the database is shut down, to check
that the data files are OK.

The idea is to read all heap blocks and check for various 'suspicious'
things like 'pd_lower > pd_upper', invalid lengths (negative lengths,
resulting in in alloc errors) etc. It might list blocks that are somehow
corrupted, dump them in a separate file etc.

Right now I do have a very simple tool that reads a given file and
performs a lot of checks at the block level (as described in bufpage.h),
and the next step should be validating basic structure of the tuples
(lengths). And that's the point where I'm stuck right now - I'm thinking
what might be the most elegant way to get info about attributes, without
access to the pg_attribute catalog (the tool is intended for offline
checks).

I've figured out the catalog-to-file mapping (in relmapper.c), but now
I'm wondering - it's just another relation, so I'd have to read the
block, parse the items and interpret them (not sure how to do that
without the pg_attribute data itself). So I wonder - what would be an
elegant solution?

regards
Tomas


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: windows consolidated cleanup
Следующее
От: Yves Weißig
Дата:
Сообщение: operator classes for index?