pg_dump and pg_dumpall fail when trying to backup database

Lists: pgsql-general
From: jack_turer(at)yahoo(dot)com (jack turer)
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump and pg_dumpall fail when trying to backup database
Date: 2004-02-18 03:17:47
Message-ID: 8a58c331.0402171917.59634b14@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I have a database in pgsql (7.3.2) on redhat 9.

When I try a 'pg_dump mydb' to back up the database, I get:
pg_dump: could not find namespace with OID 2200

Verbose version is:
-bash-2.05b$ pg_dump -v mydb | more
pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
pg_dump: could not find namespace with OID 2200
pg_dump: *** aborted because of error

Otherwise the database works just fine for daily use..etc,
just it cannot be backed up.

Anyone have any idea what is happening, or how to fix it?

Thank you!
Jack


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jack_turer(at)yahoo(dot)com (jack turer)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and pg_dumpall fail when trying to backup database
Date: 2004-02-21 00:51:31
Message-ID: 8193.1077324691@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

jack_turer(at)yahoo(dot)com (jack turer) writes:
> I have a database in pgsql (7.3.2) on redhat 9.
> When I try a 'pg_dump mydb' to back up the database, I get:

> -bash-2.05b$ pg_dump -v mydb | more
> pg_dump: saving database definition
> pg_dump: reading namespaces
> pg_dump: reading user-defined types
> pg_dump: could not find namespace with OID 2200
> pg_dump: *** aborted because of error

Hmm, I take it you dropped the public schema at some point?

I think you got bit by this 7.3 bug:

2003-01-08 16:40 tgl

* src/: backend/catalog/pg_type.c, include/catalog/pg_type.h
(REL7_3_STABLE): Repair bug noticed by Deepak Bhole: a shell type
should have a dependency on its namespace, so that it will go away
if the schema is dropped.

This fix is present in 7.3.2, but if you'd created the shell type while
running 7.3 or 7.3.1 then the dependency would still be lacking after an
update.

Anyway, what you've got is a row in pg_type that refers to a nonexistent
schema. I'd suggest (as superuser)

SELECT * FROM pg_type WHERE typnamespace = 2200;

to double-check that these rows are not something you want, then

DELETE FROM pg_type WHERE typnamespace = 2200;

regards, tom lane


From: jack_turer(at)yahoo(dot)com (jack turer)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and pg_dumpall fail when trying to backup database
Date: 2004-02-22 12:15:23
Message-ID: 8a58c331.0402220415.6615f4d@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Thank you for the idea Tom.

I tried it, and it didn't fix it (there are now no rows with
typnamespace=2200, the pg_dump fails with the same debug information
as before.

I am running 7.3.2 and never migrated from an earlier version, so
maybe this bug isn't completely licked yet in this version? Not sure..

Any additional thoughts where I should look?

Jack


From: jack_turer(at)yahoo(dot)com (jack turer)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and pg_dumpall fail when trying to backup database
Date: 2004-02-22 12:24:43
Message-ID: 8a58c331.0402220424.51a2941f@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Oh, the rerun of the pg_dump was a little different after the typnamespace
cleanup, but still failed..

pg_dump -v mydb | more
pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
pg_dump: reading user-defined functions
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined tables
pg_dump: could not find namespace with OID 2200
pg_dump: *** aborted because of error

Any thoughts?

THank you,
Jack


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jack_turer(at)yahoo(dot)com (jack turer)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and pg_dumpall fail when trying to backup database
Date: 2004-02-29 03:34:14
Message-ID: 12318.1078025654@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

jack_turer(at)yahoo(dot)com (jack turer) writes:
> Oh, the rerun of the pg_dump was a little different after the typnamespace
> cleanup, but still failed..

> pg_dump -v mydb | more
> pg_dump: saving database definition
> pg_dump: reading namespaces
> pg_dump: reading user-defined types
> pg_dump: reading user-defined functions
> pg_dump: reading user-defined aggregate functions
> pg_dump: reading user-defined operators
> pg_dump: reading user-defined operator classes
> pg_dump: reading user-defined tables
> pg_dump: could not find namespace with OID 2200
> pg_dump: *** aborted because of error

So you've still got some references to the PUBLIC schema. That's pretty
interesting --- where are they exactly? (They might be in
pg_class.relnamespace, but I'm not sure from the above.)

regards, tom lane