Order of SUBSTR and UPPER in statement

From: Hermann Muster <Hermann(dot)Muster(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Order of SUBSTR and UPPER in statement
Date: 2008-02-13 15:19:09
Message-ID: fov1p9$1l93$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Wilson 2008-02-13 15:21:51 Re: Storing images as BYTEA or large objects
Previous Message Jan Wieck 2008-02-13 15:15:20 Re: Deferred constraints and locks...