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

From Sam Mason
Subject Re: BUG #5028: CASE returns ELSE value always when type is "char"
Date
Msg-id 20090904193707.GF5407@samason.me.uk
Whole thread Raw
In response to Re: BUG #5028: CASE returns ELSE value always when type is "char"  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
On Fri, Sep 04, 2009 at 02:01:07PM -0500, Kevin Grittner wrote:
> > "char" is no different other than, by default, it happens to look a
> > lot like any value of text type.
>
> So much so that it has the same name as a text type (wrapped in
> quotes) and behaves a lot like one:

You're getting bitten by implicit casts.  Try creating a view of any
of your examples and seeing what the resulting types are, or in 8.4 an
EXPLAIN VERBOSE seems to show how it's typed the expression.

--
  Sam  http://samason.me.uk/

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5028: CASE returns ELSE value always when type is "char"
Next
From: Tom Lane
Date:
Subject: Re: lost statistics; analyze needs to execute twice