Re: Non-decimal integer literals - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Non-decimal integer literals
Date
Msg-id abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org
Whole thread Raw
In response to Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Non-decimal integer literals
List pgsql-hackers
On 8/16/21 11:51 AM, Peter Eisentraut wrote:
> Here is a patch to add support for hexadecimal, octal, and binary
> integer literals:
> 
>     0x42E
>     0o112
>     0b100101
> 
> per SQL:202x draft.

Is there any hope of adding the optional underscores?  I see a potential
problem there as SELECT 1_a; is currently parsed as SELECT 1 AS _a; when
it should be parsed as SELECT 1_ AS a; or perhaps even as an error since
0x1_a would be a valid number with no alias.

(The standard does not allow identifiers to begin with _ but we do...)
-- 
Vik Fearing



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15
Next
From: Andrew Dunstan
Date:
Subject: Re: Add jsonlog log_destination for JSON server logs