Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOKiq-0007xx-AO for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 14:08:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOKio-0003VL-Dr for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 14:08:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOKio-0003VD-6M for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 14:08:10 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOKim-00026B-0Q for pgsql-hackers@postgresql.org; Thu, 09 Sep 2021 14:08:09 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 4BA5120003; Thu, 9 Sep 2021 14:08:05 +0000 (UTC) Subject: Re: Non-decimal integer literals To: Tom Lane Cc: Peter Eisentraut , pgsql-hackers References: <3260805.1631106874@sss.pgh.pa.us> From: Vik Fearing Message-ID: <8f2cdc30-350a-9782-8d95-6865a4ccb857@postgresfriends.org> Date: Thu, 9 Sep 2021 16:08:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <3260805.1631106874@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/8/21 3:14 PM, Tom Lane wrote: > Vik Fearing 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