Re: pg_dump failed sanity check and user defined types

Поиск
Список
Период
Сортировка
От Brook Milligan
Тема Re: pg_dump failed sanity check and user defined types
Дата
Msg-id 200009111716.LAA10681@biology.nmsu.edu
обсуждение исходный текст
Ответ на Re: pg_dump failed sanity check and user defined types  (Brook Milligan <brook@biology.nmsu.edu>)
Ответы Re: pg_dump failed sanity check and user defined types
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Constant propagation and similar issues
Следующее
От: Brook Milligan
Дата:
Сообщение: operators and indexes