Re: BUG #5028: CASE returns ELSE value always when type is"char"

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5028: CASE returns ELSE value always when type is"char"
Date: 2009-09-02 16:36:00
Message-ID: 603c8f070909020936v78e2ae9cw332ff92f65000e3b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Sep 2, 2009 at 11:55 AM, Sam Mason<sam(at)samason(dot)me(dot)uk> wrote:
> In fact it doesn't seem to want to play ball at all.  Even given the
> apparently unambiguous:
>
>  SELECT 1+add(1,2);
> or
>  SELECT 'hi'||add(1,2);
>
> It doesn't get anywhere.  No need for "text 'hi'" in the second one
> because || isn't defined for values of integer type.

Right. This is exactly the sort of thing that languages with real
type inference have no problem handling. Of course, ML for example
doesn't allow overloading precisely because (AIUI) it makes type
inference difficult. It would be awesome if we could make this work
though.

...Robert

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2009-09-02 16:52:48 Re: BUG #5025: Aggregate function with subquery in 8.3 and 8.4.
Previous Message Sam Mason 2009-09-02 15:55:31 Re: BUG #5028: CASE returns ELSE value always when type is"char"