Re: Problem with LEFT function... - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with LEFT function...
Date
Msg-id 9154.1031266184@sss.pgh.pa.us
Whole thread Raw
In response to Problem with LEFT function...  ("Patrick Fiche" <patrick.fiche@aqsacom.com>)
List pgsql-general
"Patrick Fiche" <patrick.fiche@aqsacom.com> writes:
> SELECT 'Begin' || LEFT( 'String1', 3 ) ->  ERROR:  parser: parse error at or
> near "LEFT"

Use a different function name.  LEFT is a reserved word, and while PG
will let you get away with using it as a function name anyway, there
are situations like this where the normal interpretation of the keyword
takes precedence.

I've tweaked the grammar for 7.3 so that this particular case works,
but you'd still have similar problems if you were to use, say, BETWEEN
as a function name.

            regards, tom lane

pgsql-general by date:

Previous
From: "Mihai Gheorghiu"
Date:
Subject: Re: Surprise :-(
Next
From: Stephan Szabo
Date:
Subject: Re: Surprise :-(