pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roy Souther <roy@silicontao.com>
To: pgsql-admin@postgresql.org
Subject: Corrupted database, how do I fix?
Date: Tue, 5 Jun 2001 09:37:17 -0600
Message-ID: <0106050937170D.14258@OlympusMons> (raw)

First of all, I hope this is the write place to post this. If not please tell 
me.

Some time ago the HDD that my database is on died. The backups as far back as 
I can go are to be corrupted, this could be because of the drive dieing over 
time. I can not afford to loose my data so I am trying to fix the tables. 
Some are missing, others give me error when I try to read them or post to 
them.

Many tables I was able to fix by creating a new table, coping the data into 
it, drop the old corrupted table and rename the new table to the old name. 
This is very slow but it works. Some of the old corrupted tables will not 
drop. 

When I do this for example... "DROP TABLE a_bad_table" 
I get... "ERROR:  DeleteTypeTuple: a_bad_table type nonexistent"
But I can do "SELECT * FROM a_bad_table" and I see all the data, it is there.
But also when I do "SELECT * FROM pg_tables WHERE tablename = 'a_bad_table'"
I get nothing, it is not in the tables table.

I have been reading the docs for days and have not found a solution yet. 
What can I do? I was thinking I could manually add an entry for the table 
into pg_tables but I don't know if that is a good idea or even if it would 
work. Is there another table that keeps track of what is in the database?

I you need to know
postgresql version 7.0.2

-- 
Roy Souther <roy@silicontao.com>

01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110 
01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100 




view thread (2+ messages)  latest in thread

Message-ID: <0106050937170D.14258@OlympusMons>
Permalink:  ../0106050937170D.14258@OlympusMons/
Also on:    postgresql.org/message-id/0106050937170D.14258@OlympusMons

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: roy@silicontao.com
  Subject: Re: Corrupted database, how do I fix?
  In-Reply-To: <0106050937170D.14258@OlympusMons>
  References: <0106050937170D.14258@OlympusMons>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox