Re: pg_dumpall -> fails SOLVED

From: will trillich <will(at)serensoft(dot)com>
To: mweilguni(at)sime(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall -> fails SOLVED
Date: 2001-03-01 21:26:03
Message-ID: 3A9EBE68.6917EAD7@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mario Weilguni wrote:
>
> Am Mittwoch, 28. Februar 2001 10:43 schrieb will trillich:
> > so i've got my data recovered (thanks to oliver) and now
> > i wanna back it up with a pg_dumpall...
> >
> > instead, i get 'failed sanity check, type with oid 779927 was no
> > found' in the oddest places...
>
> I'm just guessing, but it is possible that you're using different versions of
> pg_dump and postmaster? I had a similar problem when I had an old 7.0 binary
> lying around in /usr/bin/ when trying to dump a 7.1 database.

no, it was that i'd been iterating through a series of

drop table xyz;
create table xyz ( ... );
drop function pdq ( xyz );
create function pdq ( xyz ) returns .... ;

when it reached the "drop function" it was referenceing an old
instance (oid) of the xyz table. then a new function was created
that referred to the new table (oid). i found six such functions
referring to nonexistent tables.

apparently postgresql does cascading correctly on rules, indexes,
and triggers when deleting tables that they depend on. but a function
argument that's defined in terms of a table -- apparently that slipped
through the cracks!

i.e.
create table eg( id int4 );
create index ed_id_idx on eg ( id );
create function go( eg ) .... ;
drop table eg; -- this also drops the index, but not the function

so, instead, now i

drop function pdq ( xyz );
drop table xyz;
create table xyz ( ... );
create function pdq ( xyz ) returns .... ;

dropping the function first, works like a charm.

--
mailto:will(at)serensoft(dot)com
http://www.dontUthink.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GH 2001-03-01 22:02:32 Re: database diff
Previous Message Brent R. Matzelle 2001-03-01 21:24:05 Re: has anybody gotten cygwin1.1.8 to work with postgresql?