Re: [SQL] Anyone recognise this error from PL/pgSQL? - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Anyone recognise this error from PL/pgSQL?
Date
Msg-id 632.934812731@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] Anyone recognise this error from PL/pgSQL?  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Responses Re: [SQL] Anyone recognise this error from PL/pgSQL?
List pgsql-sql
Stuart Rison <stuart@ludwig.ucl.ac.uk> writes:
> Yes, I remember a posting about this a little while ago, the solution was
> so simple it made you want to kick yourself!
> SELECT * INTO zhvt_row FROM zhvt
>           WHERE zhvtID=NEW.zhvtID;
> Becomes:
> SELECT * INTO zhvt_row FROM zhvt
>           WHERE zhvtID = NEW.zhvtID; --spaces on either side of the equal

> I'm wondering if this is a bug that should be corrected in the parser or if
> it is correct syntax for the operator to be bound by spaces?

I thought it might be something like that ... probably plpgsql
transforms "NEW" into something involving a "$" and then the parser
misparses "=$" as a single operator.  I'd argue that it's a plpgsql bug,
if that's right --- if plpgsql is doing text transformations that create
lexical ambiguities, it should be inserting spaces to prevent ambiguity.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Dionisio Barrantes"
Date:
Subject: unsuscribe
Next
From: Stuart Rison
Date:
Subject: Re: [SQL] Anyone recognise this error from PL/pgSQL?