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 1nCl16-0006Md-5S for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jan 2022 16:19:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCl14-00072F-Qb for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jan 2022 16:19:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCl14-00071t-Hx for pgsql-hackers@lists.postgresql.org; Wed, 26 Jan 2022 16:19:26 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCl11-0002hh-CU for pgsql-hackers@postgresql.org; Wed, 26 Jan 2022 16:19:25 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 1DAD61BF212; Wed, 26 Jan 2022 16:19:17 +0000 (UTC) Message-ID: Date: Wed, 26 Jan 2022 11:19:15 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Non-decimal integer literals Content-Language: en-US To: Alvaro Herrera , Peter Eisentraut Cc: pgsql-hackers , John Naylor References: <202201251843.ajn72lsfpt36@alvherre.pgsql> From: Andrew Dunstan In-Reply-To: <202201251843.ajn72lsfpt36@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/25/22 13:43, Alvaro Herrera wrote: > On 2022-Jan-24, Peter Eisentraut wrote: > >> +decinteger {decdigit}(_?{decdigit})* >> +hexinteger 0[xX](_?{hexdigit})+ >> +octinteger 0[oO](_?{octdigit})+ >> +bininteger 0[bB](_?{bindigit})+ > I think there should be test cases for literals that these seemingly > strange expressions reject, which are a number with trailing _ (0x123_), > and one with consecutive underscores __ (0x12__34). > > I like the idea of these literals. I would have found them useful on > many occassions. +1. I can't remember the number of times I have miscounted a long string of digits in a literal. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com