Re: [SQL] Anyone recognise this error from PL/pgSQL?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] Anyone recognise this error from PL/pgSQL?
Дата
Msg-id 632.934812731@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] Anyone recognise this error from PL/pgSQL?  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Ответы Re: [SQL] Anyone recognise this error from PL/pgSQL?  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Список 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 по дате отправления:

Предыдущее
От: "Dionisio Barrantes"
Дата:
Сообщение: unsuscribe
Следующее
От: Stuart Rison
Дата:
Сообщение: Re: [SQL] Anyone recognise this error from PL/pgSQL?