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

From Tom Lane
Subject Re: trailing junk in numeric literals
Date
Msg-id 1736272.1610817046@sss.pgh.pa.us
Whole thread Raw
In response to Re: trailing junk in numeric literals  (Vik Fearing <vik@postgresfriends.org>)
Responses Re: trailing junk in numeric literals
List pgsql-hackers
Vik Fearing <vik@postgresfriends.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.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Alter timestamp without timezone to with timezone rewrites rows
Next
From: Vik Fearing
Date:
Subject: Re: trailing junk in numeric literals