Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dF5YB-0003tY-Pp for pgsql-hackers@arkaria.postgresql.org; Sun, 28 May 2017 21:16:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dF5YA-0001Vx-NZ for pgsql-hackers@arkaria.postgresql.org; Sun, 28 May 2017 21:16:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dF5Y8-0001Uc-GX for pgsql-hackers@postgreSQL.org; Sun, 28 May 2017 21:16:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dF5Y1-0006zT-Ii for pgsql-hackers@postgreSQL.org; Sun, 28 May 2017 21:16:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4SLGOLo030909 for ; Sun, 28 May 2017 17:16:24 -0400 From: Tom Lane To: pgsql-hackers@postgreSQL.org Subject: Inconsistent syntax for NumericOnly grammar production MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30907.1496006184.1@sss.pgh.pa.us> Date: Sun, 28 May 2017 17:16:24 -0400 Message-ID: <30908.1496006184@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I noticed that gram.y has NumericOnly: FCONST { $$ = makeFloat($1); } | '-' FCONST { $$ = makeFloat($2); doNegateFloat($$); } | SignedIconst { $$ = makeInteger($1); } ; but SignedIconst: Iconst { $$ = $1; } | '+' Iconst { $$ = + $2; } | '-' Iconst { $$ = - $2; } ; The inconsistency here means that you can do, for example, regression=# set random_page_cost = +4; SET regression=# set random_page_cost = 4.2; SET but not regression=# set random_page_cost = +4.2; ERROR: syntax error at or near "4.2" LINE 1: set random_page_cost = +4.2; ^ That's weird enough in itself, and the problem is about to get more widespread because the partbound_datum production depends on NumericOnly. Any objections to allowing "+ FCONST" here? I'm inclined to fix this and back-patch it as well. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers