Thread

  1. Re: case / coalesce problem with strings WORKAROUND

    Dino Dini <dino@pod-1.com> — 2000-11-27T05:10:10Z

    I just find a workaround, which also may shed light on the bug itself:
    
    select 'hello ' || coalesce('there','there',0::text);
      ?column?
    -------------
     hello there
    (1 row)
    
    And this is very strange indeed:
    
    select 'hello ' || coalesce('there','there',0);
        ?column?
    -----------------
     hello 136357064
    (1 row)
    
    There is obviously a serious typing bug :-)
    
    -Dino
    
    ----- Original Message -----
    From: "Dino Dini" <dino@pod-1.com>
    To: <pgsql-bugs@postgresql.org>
    Sent: Sunday, November 26, 2000 9:03 PM
    Subject: case / coalesce problem with strings
    
    
    > select 'hello ' || coalesce('there','there');
    > ERROR:  Function 'text(unknown)' does not exist
    >         Unable to identify a function that satisfies the given argument
    > types
    >         You may need to add explicit typecasts
    >
    > It seems clear that the coalesce construction must return a string - so
    why
    > does this fail?
    >
    > The followinfg works just fine:
    >
    >
    > -Dino
    >