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: <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-04 19:32:17
Message-ID: 4AA124F1020000250002AAE8@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:

> I'm not certain what you're trying to say, but the above is complete
> nonsense ...

Ah, so it is. I thought someone up-thread said that in this case it
wound up as bpchar; but I see that's not so:

test=# select pg_typeof((select case when true then 'xxx' else
'a'::char(1) end));
pg_typeof
-----------
character
(1 row)

All that's done is to strip off the length.

I guess that since the "char" type is documented as being for internal
use, these issues would only affect those who choose to write queries
against catalog tables or use an internal type in their tables, so I
guess it's not worth going to extremes to make it behave like char.

Given all that, I'll conceed the point, and give a +1 for the error
message.

-Kevin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sam Mason 2009-09-04 19:37:07 Re: BUG #5028: CASE returns ELSE value always when type is "char"
Previous Message Tom Lane 2009-09-04 19:19:10 Re: BUG #5028: CASE returns ELSE value always when type is "char"