Skip site navigation (1) Skip section navigation (2)

Re: table corruption

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Thilo Hille" <thilo(at)resourcery(dot)de>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: table corruption
Date: 2003-05-20 16:22:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

> The same happens to anything above 152239. (well, i didnt tried all...)
> The first (regarding to the tabledefinition) 2 fields of row 152239 can be
> viewed. Querying other rows show the above error.
> There is no index on the table.  Is there something i can do to rescue the
> data?

First, make a copy of your files for this table ASAP, preferably to another 
HDD or another machine.   If you can't figure out which files they are, 
simple shut down PostgreSQL and back up the whole $PGDATA/base directory, 
which might be a good idea in any case.

I've seen the symptoms you describe in 2 cases:
1) A bad sector on your hard drive;
2) systems where unexpected power-outs occur frequently.

So the next thing to do is to run some kind of exhaustive HDD scan for bad 
sectors, and possibly replace the HDD.  

Finally, I take it from your e-mail that you don't have a backup of the 
database.   While there are several tools to help you scan & read and find 
corruption in postgresql files in your /contrib source, I'm not sure that any 
of them will allow you to recover your data for the affected records.

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

pgsql-novice by date

Next:From: Chris CameronDate: 2003-05-21 02:51:16
Subject: Unaccounted for disk use
Previous:From: Nabil SayeghDate: 2003-05-20 14:50:56
Subject: Re: Support for Synonyms?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group