Re: vacuum analyze fails: ERROR: Unable to locate type oid 2230924 in catalog - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: vacuum analyze fails: ERROR: Unable to locate type oid 2230924 in catalog
Date
Msg-id 200102270403.XAA10755@candle.pha.pa.us
Whole thread Raw
In response to vacuum analyze fails: ERROR: Unable to locate type oid 2230924 in catalog  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
This looks very safe and I believe should be applied.

> vacuum analyze on pg_type fails if bogus entries remain in pg_operator.
> Here is a sample script to reproduce the problem.
> 
> drop table t1;
> create table t1(i int);
> drop function foo(t1,t1);
> create function foo(t1,t1) returns bool as 'select true' language 'sql';
> create operator = (
>     leftarg = t1,
>     rightarg = t1,
>     commutator = =,
>     procedure = foo
>     );
> drop table t1;
> vacuum analyze;
> 
> To fix the problem I propose following patches. Comments?
> --
> Tatsuo Ishii
> 
> *** parse_coerce.c.orig    Sat Feb  3 20:07:53 2001
> --- parse_coerce.c    Tue Feb 27 11:33:01 2001
> ***************
> *** 190,195 ****
> --- 190,201 ----
>           Oid            inputTypeId = input_typeids[i];
>           Oid            targetTypeId = func_typeids[i];
>   
> +         if (typeidIsValid(inputTypeId) == false)
> +             return(false);
> + 
> +         if (typeidIsValid(targetTypeId) == false)
> +             return(false);
> + 
>           /* no problem if same type */
>           if (inputTypeId == targetTypeId)
>               continue;
> 


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re[2]: Re: [PATCHES] A patch for xlog.c
Next
From: Bruce Momjian
Date:
Subject: Re: Re[2]: Re: [PATCHES] A patch for xlog.c