Re: dumping tables from badly damaged db

From: Brian Ristuccia <bristucc(at)sw(dot)starentnetworks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: dumping tables from badly damaged db
Date: 2003-11-02 19:56:45
Message-ID: 20031102195645.GA20825@sw.starentnetworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sun, Nov 02, 2003 at 01:45:39PM -0500, Brian Ristuccia wrote:
>
> pg_dump: NOTICE: RelationBuildDesc: can't open deprecated_data1: No such file or directory
> pg_dump: NOTICE: RelationBuildDesc: can't open unimportant_stuff: No such file or directory
> pg_dump: handler procedure for procedural language plpgsql not found
>
> I can't drop the tables from psql:
>
> drop TABLE deprecated_data1 ;
> ERROR: cannot open deprecated_data1: No such file or directory
>

Ok. I managed to drop these in the standalone backend with some hackery:

backend> drop table useless_junk
NOTICE: RelationBuildDesc: can't open useless_junk: No such file or directory
ERROR: cannot open useless_junk: No such file or directory

So I'd have to go select on pg_class and find the relfilenode, go touch that
file so it exists. Try the drop again. Drop any indexes which don't exist.
Find the relfilenode for the associated pg_toast table and go touch that
file too. Not a lot of fun, but the destroyed tables are gone now.

> Am I likely to have success by performing surgery on the pg_table relation
> in order to remove these destroyed tables?

A simple DROP LANGUAGE did the trick.

I can now run pg_dump - I feel much better.

--
Brian Ristuccia

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message mlaks 2003-11-02 22:36:05 settings for postgresql.conf on 7.3.4 vs 7.2.1 and 7.2.4
Previous Message Brian Ristuccia 2003-11-02 18:45:39 Re: dumping tables from badly damaged db