Обсуждение: "ERROR: could not read block 4459549 in file "base/16384/16956.34": Result too large"

Поиск
Список
Период
Сортировка

"ERROR: could not read block 4459549 in file "base/16384/16956.34": Result too large"

От
wetter wetterana
Дата:
Hey, 

I got a huge database which I am populating in batches. One of the tables seemed to got 'corrupted.' I cannot query it anymore. I'm pretty sure that I could identify the batch of rows where the mistake must be, so if I could somehow revert it to an earlier state or temporary query it, I could try to delete the last batch of records I added, which might solve the problem.

I already tried to add "zero_damaged_pages = on"  to the postgresql.conf as suggested in another post here, but even then I wasn't able to query the table. 

Any help would be much appreciate, especially since I'm a psql novice ;)

Thanks!

Ana

Re: "ERROR: could not read block 4459549 in file "base/16384/16956.34": Result too large"

От
Kevin Grittner
Дата:
wetter wetterana <wetterana@gmail.com> wrote:

> Re: [GENERAL] "ERROR: could not read block 4459549 in file "base/16384/16956.34": Result too large"

> I got a huge database which I am populating in batches. One of the
> tables seemed to got 'corrupted.' I cannot query it anymore. I'm
> pretty sure that I could identify the batch of rows where the
> mistake must be, so if I could somehow revert it to an earlier
> state or temporary query it, I could try to delete the last batch
> of records I added, which might solve the problem.
>
> I already tried to add "zero_damaged_pages = on"  to the
> postgresql.conf as suggested in another post here, but even then I
> wasn't able to query the table.

zero_damaged_pages won't help if you don't read the page.  The file
should not have that many pages, and apparently doesn't, so I would
suspect a bad index.  Try REINDEX TABLE on the problem table.  This
will not share the table with any other activity, and may run for a
while so if you are at least somewhat functional and don't want to
block all access to the table for the duration of the builds you
can CREATE INDEX CONCURRENTLY on each index, drop the old index,
and rename.  Primary keys can be a particular bother this way,
though.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company