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

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jeff Davis" <pgsql(at)j-davis(dot)com>,<pgsql-bugs(at)postgresql(dot)org>, "Sam Mason" <sam(at)samason(dot)me(dot)uk>
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date: 2009-09-02 14:24:53
Message-ID: 4A9E39E5020000250002A890@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:

>> No, that's not it. I'm wondering why it isn't treated as text.
>> Period. Full stop. Nothing to infer.
>
> Because then we would have to provide implicit casts from text to
> everything else, which would be horribly dangerous.

I would like that even less. I like errors on type conflicts.

>> In my view, it is wrong that any of those work. I would expect to
>> have to code one of these:
>
>> select now() < date '2009-01-01'; -- implicit casts should cover
>> select now() < timestamp with time zone '2009-01-01 00:00:00.0';
>
> The current design is a compromise between usability and strictness
> of semantics. This proposal appears to be all strictness and no
> usability.

I was not proposing anything; I was trying to understand the reasons
for the current behavior so that I could think about what might make
sense to address some of the places where current behavior causes a
result which is different from a non-error result should be obtained
under the standard. I couldn't begin to anticipate what might be
acceptable in these situations without understanding the reason things
are as they are.

I do understand that there will be "convenience" extensions to the
standard -- all products do that. I wasn't sure whether that was the
reason for the behavior or whether there was something else in play.

Thanks for clarifying,

-Kevin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-09-02 14:39:04 Re: BUG #5028: CASE returns ELSE value always when type is "char"
Previous Message Tom Lane 2009-09-02 14:11:10 Re: BUG #5028: CASE returns ELSE value always when type is"char"