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

From Sam Mason
Subject Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date
Msg-id 20090902201722.GC5407@samason.me.uk
Whole thread Raw
In response to Re: BUG #5028: CASE returns ELSE value always when type is"char"  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: BUG #5028: CASE returns ELSE value always when type is"char"  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: BUG #5028: CASE returns ELSE value always when type is"char"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wed, Sep 02, 2009 at 02:59:54PM -0500, Kevin Grittner wrote:
> Sam Mason <sam@samason.me.uk> wrote:
> >   CREATE VIEW v (c) AS
> >     SELECT NULL;
> >
> > PG allows it, but the resulting view seems somewhat unusable.
>
> 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?  Bear in mind that my simple NULL could be an arbitrarily complex
expression, I've just chosen a simple NULL for pedagogic reasons.

I can only see a requirement that the chosen type must be compatible.
That seems to leave it open to arbitrarily choosing any type in this
case.

--
  Sam  http://samason.me.uk/

pgsql-bugs by date:

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