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

From Kevin Grittner
Subject Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date
Msg-id 4A9E8DBF020000250002A95C@gw.wicourts.gov
Whole thread Raw
In response to Re: BUG #5028: CASE returns ELSE value always when type is"char"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #5028: CASE returns ELSE value always when type is"char"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> Yep.  I don't know if it would be remotely feasible, but the
>> implementation which seems like it would be "standard-safe" but
>> still give reasonable concessions to those wanting to skip the
>> extra keystrokes of declaring the type of literals which are not
>> character based would be to go with the suggestion of having a
>> character string literal type, and change the semantics such that
>> if there is a valid interpretation of the statement with the
>> character string literal taken as text, it should be used; if not,
>> resolve by current "unknown" rules.
>
> There is already a weak preference for resolving unknown as text in
> the presence of multiple alternatives.  So I'm not sure that you're
> suggesting anything different from what happens now.  In particular,
> weren't you the same person complaining a moment ago about
> COALESCE(NULL,NULL) defaulting to text?  Why is that bad if the
> above is good?

Because COALESCE(NULL, NULL) has given no indication that it is
character based, while 'x' is defined by the standard to be a
character string literal.  The two uses of "unknown" in typing seem to
be solving different problems.  Perhaps using the same flag for both
is part of the problem.  The above was suggesting we differentiate.

-Kevin

pgsql-bugs by date:

Previous
From: Sam Mason
Date:
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"
Next
From: Jaime Casanova
Date:
Subject: Re: BUG #5030: Problem on "RETURN QUERY EXECUTE" when a column is dropped from a table