Skip site navigation (1) Skip section navigation (2)

Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Geoff Tolley <geoff(dot)tolley(at)yougov(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped
Date: 2009-10-08 15:38:12
Message-ID: 24565.1255016292@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
... Actually, I just noticed that there *is* a bug here:

regression=# select '1' /* foo
regression*# */
regression-# '2';
ERROR:  syntax error at or near "'2'"
LINE 3: '2';
        ^
regression=# 

The above should be accepted, but it isn't.  I think the problem is
here:

special_whitespace		({space}+|{comment}{newline})

Shouldn't that be

special_whitespace		({space}+|{comment}|{newline})

?  Although I'm not quite sure how this leads to the error, because
I didn't type anything between the second return and the '2', so in

whitespace_with_newline	({horiz_whitespace}*{newline}{special_whitespace}*)

the {special_whitespace}* should have been satisfied with zero
repetitions no matter what.  Odd ...

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2009-10-08 16:01:11
Subject: Re: BUG #5102: Silent IN (list of strings) failure to detect syntax error when list is linewrapped
Previous:From: Dominic BevacquaDate: 2009-10-08 15:29:51
Subject: incorrect exit code from psql with single transaction + violation of deferred FK constraint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group