BUG #15273: Lexer bug with UESCAPE

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: ladayaroslav(at)yandex(dot)ru
Subject: BUG #15273: Lexer bug with UESCAPE
Date: 2018-07-10 17:15:13
Message-ID: 153124291307.1408.15617588871690313363@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15273
Logged by: Yaroslav Schekin
Email address: ladayaroslav(at)yandex(dot)ru
PostgreSQL version: 10.4
Operating system: Any
Description:

Hello.

Compare this:
> SELECT U&'a' UESCAPE 'x';
----------
a
(1 row)
To this:
> SELECT U&'a' /*c1*/ UESCAPE /*c2*/ 'x';

ERROR: syntax error at or near "'x'"
LINE 1: SELECT U&'a' /*c1*/ UESCAPE /*c2*/ 'x';
^
I think the former is a bug, as, per ISO SQL, a comment is equivalent to
whitespace (with newline), and therefore, should be ignored here.

(Thanks a lot to RhodiumToad who not only initially found and documented
https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard#Lexing_of_split_string_literals,
but also discussed it with me on IRC and conducted the investigation of
relevant SQL standards.)

--
WBR, Yaroslav Schekin.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-07-10 19:50:51 Re: BUG #15273: Lexer bug with UESCAPE
Previous Message Tom Lane 2018-07-10 13:58:28 Re: BUG #15272: creating an index function terminate with error