Re: Order of SUBSTR and UPPER in statement - Mailing list pgsql-general

From Carlo Stonebanks
Subject Re: Order of SUBSTR and UPPER in statement
Date
Msg-id fphk3f$1cfj$1@news.hub.org
Whole thread Raw
In response to Order of SUBSTR and UPPER in statement  (Hermann Muster <Hermann.Muster@gmx.de>)
List pgsql-general
"Hermann Muster" <Hermann.Muster@gmx.de> wrote in message
news:fov1p9$1l93$1@news.hub.org...
> 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Regex query not using index
Next
From: "Postgres User"
Date:
Subject: Re: Regex query not using index