Thread: Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19
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
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?
thanks!
wu.xia
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
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?
thanks!
wu.xia
Re: Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19
From
Craig Ringer
Date:
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/
I reconvery it by \copy command.
thanks very much.
thanks very much.
2010/9/13 Craig Ringer <craig@postnewspapers.com.au>
On 11/09/10 14:21, 夏武 wrote:> *DELETE FROM pg_type where relnamespace=73033*
> 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*
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.Your best chance is to do a pg_dump of each table, one by one, using the
> 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?
"--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/
Re: Help! pg_dump: Error message from server: ERROR: cache lookup failed for type 19
From
Craig Ringer
Date:
On 14/09/2010 11:02 AM, 夏武 wrote: > I reconvery it by \copy command. > thanks very much. Glad to help. In future, it might be a good idea to: - Keep regular pg_dump backups; and - Avoid trying to alter the system catalogs With Slony you can never completely avoid needing to mess with the catalogs, as it seems to be able to get things into a nasty state sometimes. However, if you do have to do catalog work it's a good idea to ask for help here *before* doing anything, because it'll be easier to fix if you haven't deleted catalog entries etc. -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/