Re: pg_dump failed sanity check and user defined types

From: Brook Milligan <brook(at)biology(dot)nmsu(dot)edu>
To: brook(at)biology(dot)nmsu(dot)edu
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump failed sanity check and user defined types
Date: 2000-09-11 17:16:03
Message-ID: 200009111716.LAA10681@biology.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> pg_dump -sc -D test > pg_dump.schema || true
> failed sanity check, type with oid 3516132 was not found

The problem seems to be related to trying to install conversion
functions from one user defined type to another. Scripts like the
following are fine:

DROP TYPE xxx;

DROP FUNCTION xxx_in (opaque);
CREATE FUNCTION xxx_in (opaque) RETURNS xxx AS '_OBJWD_/xxx.so', 'xxx_in' LANGUAGE 'c';

DROP FUNCTION xxx_out(opaque);
CREATE FUNCTION xxx_out(opaque) RETURNS opaque AS '_OBJWD_/xxx.so', 'xxx_out' LANGUAGE 'c';

CREATE TYPE xxx (internallength = 8, input = xxx_in, output = xxx_out);

DROP TYPE yyy;

DROP FUNCTION yyy_in (opaque);
CREATE FUNCTION yyy_in (opaque) RETURNS yyy AS '_OBJWD_/xxx.so', 'yyy_in' LANGUAGE 'c';

DROP FUNCTION yyy_out(opaque);
CREATE FUNCTION yyy_out(opaque) RETURNS opaque AS '_OBJWD_/xxx.so', 'yyy_out' LANGUAGE 'c';

CREATE TYPE yyy (internallength = 8, input = yyy_in, output = yyy_out);

But as soon as I add a conversion like the following to the end (I
presume conversion functions must follow the type definitions), I get
failed sanity checks.

DROP FUNCTION xxx (yyy);
CREATE FUNCTION xxx (yyy) RETURNS xxx AS '_OBJWD_/xxx.so', 'xxx_int' LANGUAGE 'c';

I presume that notices like the following

NOTICE: ProcedureCreate: type 'xxx' is not yet defined

are fine, because you must create the I/O functions before the type.

So, how is one really supposed to create user defined types with
conversion functions without tripping on failed sanity checks?
Where else in the system catalogs can I look to find references to
the missing OIDs?

Thanks again for your help.

Cheers,
Brook

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brook Milligan 2000-09-11 18:22:59 operators and indexes
Previous Message Thomas Lockhart 2000-09-11 16:37:01 Re: Constant propagation and similar issues