Re: could not open relation 1663/16525/2604: no such file or dir - Mailing list pgsql-admin

From Tom Lane
Subject Re: could not open relation 1663/16525/2604: no such file or dir
Date
Msg-id 25343.1184166190@sss.pgh.pa.us
Whole thread Raw
In response to Re: could not open relation 1663/16525/2604: no such file or dir  (Hannes Dorbath <light@theendofthetunnel.de>)
List pgsql-admin
Hannes Dorbath <light@theendofthetunnel.de> writes:
> On 11.07.2007 12:09, giuseppe.derossi@email.it wrote:
>> alfter my computer chrashing, when I try to read a table by using pgAdmin I
>> get the following errors:
>> could not open relation 1663/16525/2604
>> could not open relation 1663/16525/2611
>> could not open relation 1663/16525/2604

> 1.) Do backups
> 2.) Disable write caching in your I/O sub system unless it's battery backed.

Yeah.  Postgres cannot defend against the filesystem losing entire files.

> Shutdown PG, backup $PGDATA directory, start PG, try REINDEX DATABASE
> <you_db>;. If that doesn't help anything, there are some tools available
> on pg foundry to inspect the raw files in $PGDATA. You might be able to
> get some of your data back using them.

REINDEX won't help get back missing tables :-(.  In this case he's
missing at least pg_attrdef and pg_inherits:

regression=# select 2604::regclass;
  regclass
------------
 pg_attrdef
(1 row)

regression=# select 2611::regclass;
  regclass
-------------
 pg_inherits
(1 row)

So if this is the *only* damage then he could dump and perhaps manually
reconstruct the missing DEFAULT and INHERITS clauses (if any).  The real
problem is that this is likely only the tip of the iceberg :-(

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.2.4 patches?
Next
From: Chris Browne
Date:
Subject: Re: linux os