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 1mNwwh-00016C-6w for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Sep 2021 12:44:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNwwg-0006Xg-1d for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Sep 2021 12:44:54 +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 1mNwwf-0006XY-MA for pgsql-hackers@lists.postgresql.org; Wed, 08 Sep 2021 12:44:53 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNwwc-0007CJ-Jt for pgsql-hackers@postgresql.org; Wed, 08 Sep 2021 12:44:52 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id F1E6810000E; Wed, 8 Sep 2021 12:44:46 +0000 (UTC) Subject: Re: Non-decimal integer literals To: Peter Eisentraut , pgsql-hackers References: From: Vik Fearing Message-ID: Date: Wed, 8 Sep 2021 14:44:45 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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