Re: Order of SUBSTR and UPPER in statement

From: "Carlo Stonebanks" <stonec(dot)register(at)sympatico(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Order of SUBSTR and UPPER in statement
Date: 2008-02-20 16:22:11
Message-ID: fphk3f$1cfj$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


"Hermann Muster" <Hermann(dot)Muster(at)gmx(dot)de> wrote in message
news:fov1p9$1l93$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> Hi,
>
> I encountered something I can't really explain. I use the following
> statement in my application:
>
> COALESCE(UPPER(SUBSTR("Y"."Firma",1,7)),'')
>
> This returns "ERROR: syntax error at end of input"
>
>
> However, using the following statement is fine:
>
> COALESCE(SUBSTR(UPPER("X"."Firma"), 1, 7), '')
>
>
> The fieldtype of "Firma" is character varying.
>
> The only difference is the order of UPPER and SUBSTR. Is it possible that
> this changed during some PostgreSQL version update? By the way, right now
> I'm using 8.2.
>
> Regards,
> Hermann

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-02-20 16:31:54 Re: Regex query not using index
Previous Message Geoffrey 2008-02-20 15:24:05 Re: is a unique key on null field bad?