Re: BUG #5028: CASE returns ELSE value always when type is"char"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date: 2009-09-02 20:55:58
Message-ID: 29037.1251924958@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sam Mason <sam(at)samason(dot)me(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-09-02 21:01:44 Re: BUG #5028: CASE returns ELSE value always when type is"char"
Previous Message Kevin Grittner 2009-09-02 20:46:43 Re: BUG #5028: CASE returns ELSE value always when type is"char"