Re: check database integrity

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: check database integrity
Дата
Msg-id 22773.1406041120@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: check database integrity  (Torsten Förtsch <torsten.foertsch@gmx.net>)
Ответы Re: check database integrity  (Torsten Förtsch <torsten.foertsch@gmx.net>)
Список pgsql-general
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= <torsten.foertsch@gmx.net> writes:
> On 21/07/14 16:17, Tom Lane wrote:
>> Could you trace through it and see where the results diverge?  Also,
>> what's the actual size of the file on disk?

> After a fresh restart of the database I attached strace to the backend.
> There are only 2 lines in the output that mention that relation:
> open("base/25317/11790", O_RDWR)        = 35
> lseek(35, 0, SEEK_END)                  = 8192
> This happened during this query:
> select get_raw_page(2836::oid::regclass::text, 'fsm', 1);
> Shouldn't it rather open 11790_fsm?

Doh.  I looked right at this code in get_raw_page yesterday:

    if (blkno >= RelationGetNumberOfBlocks(rel))
        elog(ERROR, "block number %u is out of range for relation \"%s\"",
             blkno, RelationGetRelationName(rel));

RelationGetNumberOfBlocks reports the length of the main fork ... but
this check is applied regardless of which fork we're reading.  Should
be using RelationGetNumberOfBlocksInFork, of course.

            regards, tom lane


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Fwd: Need r_constraint_name
Следующее
От: David Johnston
Дата:
Сообщение: Re: Referencing serial col's sequence for insert