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 4AA124F1020000250002AAE8@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>)
List pgsql-bugs
Tom Lane <tgl@sss.pgh.pa.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

pgsql-bugs by date:

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