Re: Non-decimal integer literals

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Non-decimal integer literals
Date: 2021-09-08 12:44:45
Message-ID: abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-09-08 12:46:44 Re: Add jsonlog log_destination for JSON server logs
Previous Message Pavel Stehule 2021-09-08 12:41:27 Re: Schema variables - new implementation for Postgres 15