From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vik Fearing <vik@postgresfriends.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Non-decimal integer literals
Date: Wed, 08 Sep 2021 09:14:34 -0400
Message-ID: <3260805.1631106874@sss.pgh.pa.us> (raw)
In-Reply-To: <abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org>
References: <b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com>
<abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org>
Vik Fearing <vik@postgresfriends.org> writes:
> 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.
Even without that point, this patch *is* going to break valid queries,
because every one of those cases is a valid number-followed-by-identifier
today, e.g.
regression=# select 0x42e;
x42e
------
0
(1 row)
AFAIR we've seen exactly zero field demand for this feature,
so I kind of wonder why we're in such a hurry to adopt something
that hasn't even made it past draft-standard status.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, vik@postgresfriends.org, peter.eisentraut@enterprisedb.com
Subject: Re: Non-decimal integer literals
In-Reply-To: <3260805.1631106874@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox