pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Non-decimal integer literals
Date: Thu, 9 Sep 2021 16:08:04 +0200
Message-ID: <8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org> (raw)
In-Reply-To: <3260805.1631106874@sss.pgh.pa.us>
References: <b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com>
	<abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org>
	<3260805.1631106874@sss.pgh.pa.us>

On 9/8/21 3:14 PM, Tom Lane wrote:
> Vik Fearing <vik@postgresfriends.org> writes:
> 
>> 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,

Ah, true that.  So if this does go in, we may as well add the
underscores at the same time.

> AFAIR we've seen exactly zero field demand for this feature,

I have often wanted something like this, even if I didn't bring it up on
this list.  I have had customers who have wanted this, too.  My response
has always been to show these exact problems to explain why it's not
possible, but if it's going to be in the standard then I favor doing it.

I have never really had a use for octal, but sometimes binary and hex
make things much clearer.  Having a grouping separator for large numbers
is even more useful.

> 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.
I don't really see a hurry here.  I am fine with waiting until the draft
becomes final.
-- 
Vik Fearing





view thread (62+ messages)  latest in thread

Message-ID: <8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org>
Permalink:  ../8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org/
Also on:    postgresql.org/message-id/8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org

 · 

reply

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: vik@postgresfriends.org, tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com
  Subject: Re: Non-decimal integer literals
  In-Reply-To: <8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org>

* 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