Re: Zeroing single tuple in data file. - Mailing list pgsql-admin

From Matthew Walden
Subject Re: Zeroing single tuple in data file.
Date
Msg-id AANLkTi=kXzF=B+cRzXcXrj9-S1WZmxtu=ukaADMXr9T=@mail.gmail.com
Whole thread Raw
In response to Re: Zeroing single tuple in data file.  (Lukasz Brodziak <lukasz.brodziak@gmail.com>)
Responses Re: Zeroing single tuple in data file.
List pgsql-admin
And the \d+ on users?  Also would you mind pasting the output exactly as it is appears on screen, assuming it is in English?

I'm trying to build up a picture here of how many problems you have and whether they can be fixed conventionally with the database interface or whether you need to start messing around with the data files.  If the case is the latter, you won't be able to just remove the single rows that are causing the problem - you will loose full pages.  It could be that it is actually a corrupt index rather than the table - in this case the \d+ will help me assist you in disabling that index.

You can take a look at this guide if you suspect block corruption -

http://blog.endpoint.com/2010/06/tracking-down-database-corruption-with.html

BUT I would try everything else first.  You will loose data if you follow that approach (but it may not be avoidable).  If your database is a production one (I don't know the environment you are using this database in) then this would need to be a last ditch attempt to salvage otherwise lost data.  In any case it sounds like you have some kind of hardware issue and should consider a full backup restore if possible and then afterwards running frequent ANALYZE; commands to quickly detect further corruptions.

On Mon, Nov 22, 2010 at 7:36 AM, Lukasz Brodziak <lukasz.brodziak@gmail.com> wrote:
And the version is 8.2.4

2010/11/22 Lukasz Brodziak <lukasz.brodziak@gmail.com>:
> Hello,
>
> I got access to corrupted DB... The SELECT COUNT(*) FROM users where
> id_usr IS NULL returned error of invalid page header in one of the
> blocks...

pgsql-admin by date:

Previous
From: Khangelani Gama
Date:
Subject: Postgres database : Out of balance problem from the same table
Next
From: Lukasz Brodziak
Date:
Subject: Re: Zeroing single tuple in data file.