Re: BUG #5028: CASE returns ELSE value always when type is"char" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date
Msg-id 29037.1251924958@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5028: CASE returns ELSE value always when type is"char"  (Sam Mason <sam@samason.me.uk>)
Responses Re: BUG #5028: CASE returns ELSE value always when type is"char"  (Greg Stark <gsstark@mit.edu>)
List pgsql-bugs
Sam Mason <sam@samason.me.uk> writes:
> On Wed, Sep 02, 2009 at 02:59:54PM -0500, Kevin Grittner wrote:
>> I'm not sure whether the only place the standard doesn't require a
>> cast is on assignment, but this is one place that the standard clearly
>> does require a cast, and I'm all for that.

> I'm probably missing something obvious again, but where does it say
> that?

They express it as a syntactic constraint not a semantic one.  NULL
without decoration is a <contextually typed value specification>
which is allowed in only a limited number of places.  One place
it's allowed is inside a <cast specification>, which is reachable
from <value expression>.  The latter is allowed in lots of places.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"
Next
From: Tom Lane
Date:
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"