Re: trailing junk in numeric literals - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: trailing junk in numeric literals
Date
Msg-id 3b6a5923-2e33-b5e1-2cec-b09f90b7d669@enterprisedb.com
Whole thread Raw
In response to Re: trailing junk in numeric literals  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: trailing junk in numeric literals
Re: trailing junk in numeric literals
List pgsql-hackers
On 2020-12-28 21:54, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>> I was surprised to find that this doesn't error:
>> => select 100a;
>>     a
>> -----
>>    100
> 
>> I suspect this and similar cases used to error before aliases without AS
>> were introduced.  But now this seems possibly problematic.  Should we
>> try to handle this better?
> 
> Meh.  I think you'd get more brickbats than kudos if you start insisting
> on a space there.
> 
> I'm too lazy to try to decipher the SQL spec right now, but ISTR that
> it insists on whitespace between a numeric literal and an identifier.

Yeah, non-delimiter tokens are supposed to be separated by delimiter tokens.

> So strictly speaking this SQL code is nonstandard anyway.  But our
> lexer has always been forgiving about not requiring space if it's
> not logically necessary to separate tokens.  I doubt trying to
> change that would improve matters.

Well, the idea is to diagnose potential typos better.  But if there is 
no interest, then that's fine.



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: OpenSSL connection setup debug callback issue
Next
From: Michael Paquier
Date:
Subject: Re: doc review for v14