Re: Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: 夏武 <xia(dot)wu(dot)cn(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19
Date: 2010-09-13 04:01:35
Message-ID: 4C8DA21F.8070703@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/09/10 14:21, 夏武 wrote:
> i use the slony for replication of postgresql database. it work fine
> some day.
> After i use the slony command to delete the replication node, pg_dump
> does not work, the error message is:
> *pg_dump: schema with OID 73033 does not exist*
>
> Then i delete the name space of slony in pg_namespace, and pg_dump does
> not work.
> So i delete the data of the name space in pg_class, pg_type, the command is:
> *DELETE FROM pg_class where relnamespace=73033*
> *DELETE FROM pg_type where relnamespace=73033*

That might not have been a very good idea. You're really not meant to go
messing with the catalog unless you *really* know what you are doing.

It sounds like you have a very badly messed up catalog. You will need to
find a way to dump your database so you can drop it, re-create it and
reload it.

> i got the error message:
> pg_dump: Error message from server: ERROR: cache lookup failed for type 19

> How to fix it? How to recovery the database?

Your best chance is to do a pg_dump of each table, one by one, using the
"--table" option. Find out which table or tables are failing.

Once you know that, post here with the table definition, the exact
error, and the output of "select * from pg_class" and "select * from
pg_type". Somebody might be able to help you if there's enough information.

Alternately, you might be able to extract the data from the problem
table(s) using the \copy command from psql. Then you can re-create them
in the new database and re-load their contents with \copy .

--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brodie Thiesfield 2010-09-13 04:12:40 Re: Change the UI language of psql connection
Previous Message Craig Ringer 2010-09-13 03:57:56 Re: JSON output