Re: ERROR: could not read block 4707 of relation 1663/16384/16564: Success

From: Deniz Atak <denizatak(at)gmail(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: could not read block 4707 of relation 1663/16384/16564: Success
Date: 2011-08-01 11:55:33
Message-ID: CAL30GtE7EcA0r3iDtcrJ3vFaEtiGWN+tS63trZ6AaR=VaDysug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Thomas,

thanks for your answer. We decided not to go further with this error,
because soon we will have another product that replaces this one. Because I
want to learn more about this topic, I did the following:

Before I write your code, I tried:
select oid,ctid,relname from pg_class where ctid='(4707,0)';

but it resulted in:
oid | ctid | relname
-----+------+---------
(0 rows)

Isn't there suppose to be a ctid of '(4707,0)'? Or did I misunderstand what
you have written?

Regards,
Deniz

On Mon, Aug 1, 2011 at 1:21 PM, Tomas Vondra <tv(at)fuzzy(dot)cz> wrote:

> On 1 Srpen 2011, 8:27, Deniz Atak wrote:
> > Deepak, Tom thanks for answering.
> >
> > Tom, we have psql 8.1.18. So you are right, this weird message is because
> > of
> > the old version. I will check with my colleague about the possible
> > reasons.
> > What can I do if there is a messed up table?
>
> First of all, you should find out what caused the mess. This could be
> really difficult as it might be a rare hw or sw glitch. Anyway consider
> upgrading to 8.1.23 if possible.
>
> If you have a fresh backup (i.e. one with all the data in the table), just
> restore it and use it. You may even use just this particular table (just
> move it using COPY).
>
> If you need to recover the data, you'll have to play a bit with it as you
> need to 'skip' all the corrupted blocks. The query reports block 4707 is
> corrupted - how many blocks does the relation have?
>
> You can skip the blocks using 'ctid' column, which is basically "(block
> id, item id)" so to skip block 4707 you can do this
>
> SELECT * FROM table WHERE (ctid < '(4707,0)'::ctid OR ctid >=
> '(4708,0)'::ctid)
>
> and if fails with another "could not read block" error, put there another
> such condition.
>
> Tomas
>
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo Neto 2011-08-01 14:09:43 Error: operator does not exist: integer = integer
Previous Message Tomas Vondra 2011-08-01 10:21:29 Re: ERROR: could not read block 4707 of relation 1663/16384/16564: Success