Re: sanity check fails - Mailing list pgsql-sql

From Tom Lane
Subject Re: sanity check fails
Date
Msg-id 9768.958452573@sss.pgh.pa.us
Whole thread Raw
In response to sanity check fails  (Johann Spies <jhspies@adept.co.za>)
List pgsql-sql
Johann Spies <jhspies@adept.co.za> writes:
> When I try to backup my database using pg_dump I get the following error:
> --  dumping out user-defined functions
> failed sanity check,  type with oid 96867 was not found
> How can I correct that?

It sounds like you had a user-defined type that you deleted without
first having deleted all the functions that accepted or returned that
type.  You can look for the culprit function with
select * from pg_proc where prorettype = 96867 or    pg_proc.proargtypes[0] = 96867 or    pg_proc.proargtypes[1] =
96867or    ...    pg_proc.proargtypes[7] = 96867;
 

Some room for improvement here, obviously: pg_dump ought to identify
where it found the dangling type reference, and even better you
shouldn't be able to drop a still-referenced type in the first place...
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: is multiple insert possible with posgress?
Next
From: Erol Oz
Date:
Subject: Re: is multiple insert possible with posgress?