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 1jWMzQ-0004kp-Am for pgsql-general@arkaria.postgresql.org; Wed, 06 May 2020 16:33:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jWMzP-0001Mn-7C for pgsql-general@arkaria.postgresql.org; Wed, 06 May 2020 16:33:43 +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 1jWMzO-0001Mg-VA for pgsql-general@lists.postgresql.org; Wed, 06 May 2020 16:33:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWMzM-000669-LX for pgsql-general@postgresql.org; Wed, 06 May 2020 16:33:42 +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 046GXXea015750; Wed, 6 May 2020 12:33:33 -0400 From: Tom Lane To: Thom Brown cc: Adrian Klaver , PGSQL Mailing List Subject: Re: White space affecting parsing of range values In-reply-to: References: <597b7d3a-170c-5c17-00db-1702c69ac59a@aklaver.com> Comments: In-reply-to Thom Brown message dated "Wed, 06 May 2020 17:19:51 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15748.1588782813.1@sss.pgh.pa.us> Date: Wed, 06 May 2020 12:33:33 -0400 Message-ID: <15749.1588782813@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thom Brown writes: > I guess I should read the docs more carefully. Shouldn't this be > insignificant for a numeric value? That would require the range code to know whether the subtype considers whitespace significant (or perhaps more usefully, whether an all-spaces input is valid). We've stayed away from requiring range_in to have any type-specific knowledge of that sort. Still, you could argue that the rule ought to be "an empty or all-blank value must be quoted to distinguish it from an omitted bound" rather than "an empty value must be quoted to distinguish it from an omitted bound". I'm not sure if we could get away with redefining that at this point, though. It looks like range_out quotes such values already, so maybe a change wouldn't be totally catastrophic (in the sense of breaking dump files). But I still suspect there would be more people unhappy than happy. regards, tom lane