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: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: 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 21:01:44
Message-ID: 29117.1251925304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> 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.

I've always thought that having the type system treat NULL and 'foo'
alike was a feature, not a bug. In a formal sense the type information
available is the same, ie, none. The argument that SQL says 'foo'
must be character, so we should too, is greatly weakened by the fact
that SQL has such an impoverished set of built-in types. If we want
to treat user-defined types as anything approaching first-class types,
we have to be pretty suspicious of that restriction.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2009-09-02 21:26:50 Re: BUG #5028: CASE returns ELSE value always when type is"char"
Previous Message Tom Lane 2009-09-02 20:55:58 Re: BUG #5028: CASE returns ELSE value always when type is"char"