Re: [HACKERS] case bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] case bug?
Date
Msg-id 14729.937064068@sss.pgh.pa.us
Whole thread Raw
In response to case bug?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> Following case statement is legal but fails in 6.5.1.
> select i,
>   case
>     when i < 0 then 'minus'
>     when i = 0 then 'zero'
>     when i > 0 then  'plus'
>     else null
>   end
> from t1;
> ERROR:  Unable to locate type oid 0 in catalog

Still there in current sources, too.  Looks like it's the "else null"
that triggers the problem --- probably the code that is resolving the
final output type of the CASE expression isn't coping with a null.

I think this is Lockhart's turf, but I can have a go at it if he hasn't
got time to work on it...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] case bug?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] serial type