BUG #15273: Lexer bug with UESCAPE - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15273: Lexer bug with UESCAPE
Date
Msg-id 153124291307.1408.15617588871690313363@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #15273: Lexer bug with UESCAPE
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15273
Logged by:          Yaroslav Schekin
Email address:      ladayaroslav@yandex.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.


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15272: creating an index function terminate with error
Next
From: Tom Lane
Date:
Subject: Re: BUG #15273: Lexer bug with UESCAPE