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 1nKHHS-0001d5-Ks for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 10:11:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKHHQ-0007cq-SW for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 10:11:24 +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 1nKHHP-0007ch-Q5 for pgsql-hackers@lists.postgresql.org; Wed, 16 Feb 2022 10:11:24 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKHHE-0006AN-99 for pgsql-hackers@postgresql.org; Wed, 16 Feb 2022 10:11:23 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3B9835C0154; Wed, 16 Feb 2022 05:11:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 16 Feb 2022 05:11:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=pd6lYQhQvP6NLJZnuAN+8OfYCNXQvkaiwnsma+vyp A4=; b=gO712dxy3/4HvluYkR+kekHQuhlm219zu0hloxFBlzMmXqgBRwRwkViRz l7aTrL2+FwJzMD0sNBi2U+cy2s6M8kKb1Ndb6xeoPgkkPGR2ATnuBLWqTJoWkHDC oPMzy0TgDYPALefJApZVs3NZHd6mboQV37+ulxHxhwlFmRYFtST0UDJNcn9mhenx 3xo6/51oSB1tCz/yA34wI5rpImSnKxHicX+wK5EOQC7pstAPlYkb09OFMnMfL2JM GHFwLwYdY7MZQH7ciKoy8KMBBvl6VoRyLz21S03g2z3/eFMLpEqjg59vbx+58+Xo ETODmadDkCpUp3fiKe+QYArWsEF/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjeeigdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefjeegheetuefhveevudel ueeftdejteeiffetvdduhfdtieefgfeutedtveeggfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Feb 2022 05:11:07 -0500 (EST) Message-ID: Date: Wed, 16 Feb 2022 11:11:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Non-decimal integer literals Content-Language: en-US To: John Naylor Cc: Tom Lane , Robert Haas , pgsql-hackers References: <31bba70a-f5a8-9276-37a6-fa6f2c4eee6c@enterprisedb.com> <0d895aa8-d1de-3637-9ad4-de0269918e77@enterprisedb.com> <0f37d2ec-6689-4d23-7ba5-4d2a73c2666f@enterprisedb.com> <577603ec-787b-61b8-23a2-1bd0457ed1c7@enterprisedb.com> <2317133.1643155358@sss.pgh.pa.us> <97aa22d7-b80f-efa1-f368-3dbf73a15980@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 13.02.22 13:14, John Naylor wrote: > On Wed, Jan 26, 2022 at 10:10 PM Peter Eisentraut > wrote: >> [v8 patch] > > 0001-0004 seem pretty straightforward. These have been committed. > > 0005: > > {realfail1} { > - /* > - * throw back the [Ee], and figure out whether what > - * remains is an {integer} or {decimal}. > - */ > - yyless(yyleng - 1); > SET_YYLLOC(); > - return process_integer_literal(yytext, yylval); > + yyerror("trailing junk after numeric literal"); > } > > realfail1 has been subsumed by integer_junk and decimal_junk, so that > pattern can be removed. Committed with that change. I found that the JSON path lexer has the same trailing-junk issue. I have researched the relevant ECMA standard and it explicitly points out that this is not allowed. I will look into that separately. I'm just pointing that out here because grepping for "realfail1" will still show a hit after this. The remaining patches are material for PG16 at this point, and I will set the commit fest item to returned with feedback in the meantime. > 0006: > > Minor nit -- the s/decimal/numeric/ change doesn't seem to have any > notational advantage, but it's not worse, either. I did that because with the addition of non-decimal literals, the word "decimal" becomes ambiguous or misleading. (It doesn't mean "uses decimal digits" but "has a decimal point".) (Of course, "numeric" isn't entirely free of ambiguity, but there are only so many words available in this space. ;-) ) > 0007: > > I've attached an addendum to restore the no-backtrack property. Thanks, that is helpful. > Will the underscore syntax need treatment in the input routines as well? Yeah, various additional work is required for this.