Re: trailing junk in numeric literals

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: trailing junk in numeric literals
Date: 2021-01-16 17:19:08
Message-ID: 3d8da0b9-bc39-ba19-332d-c4d40d0c50fb@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/16/21 6:10 PM, Tom Lane wrote:
> Vik Fearing <vik(at)postgresfriends(dot)org> writes:
>> On 1/16/21 4:32 PM, Andreas Karlsson wrote:
>>> On 1/16/21 2:02 PM, Vik Fearing wrote:
>>>> I am in favor of such a change so that we can also accept 1_000_000
>>>> which currently parses as "1 AS _000_000" (which also isn't compliant
>>>> because identifiers cannot start with an underscore, but I don't want to
>>>> take it that far).
>>>> It would also allow us to have 0xdead_beef, 0o_777, and 0b1010_0000_1110
>>>> without most of it being interpreted as an alias.
>
>>> That would be a nice feature. Is it part of the SQL standard?
>
>> Yes, all of that is in the standard.
>
> Really? Please cite chapter and verse. AFAICS in SQL:2011 5.3 <literal>,
> a numeric literal can't contain any extraneous characters, just sign,
> digits, optional decimal point, and optional exponent. Hex and octal
> literals are certainly not there either.

With respect, you are looking at a 10-year-old document and I am not.

5.3 <literal> has since been modified.
--
Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-01-16 17:34:52 Re: Printing backtrace of postgres processes
Previous Message Tom Lane 2021-01-16 17:10:46 Re: trailing junk in numeric literals