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 1jgcIX-0004aQ-1g for pgsql-general@arkaria.postgresql.org; Wed, 03 Jun 2020 22:55:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgcIV-0002zn-UG for pgsql-general@arkaria.postgresql.org; Wed, 03 Jun 2020 22:55:47 +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 1jgcIV-0002zg-Mq for pgsql-general@lists.postgresql.org; Wed, 03 Jun 2020 22:55:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgcIT-0000Wt-Hd for pgsql-general@postgresql.org; Wed, 03 Jun 2020 22:55:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 053Mti531154087; Wed, 3 Jun 2020 18:55:44 -0400 From: Tom Lane To: Michael Nolan cc: "pgsql-general@postgresql.org" Subject: Re: A parsing question In-reply-to: References: Comments: In-reply-to Michael Nolan message dated "Wed, 03 Jun 2020 17:41:37 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1154085.1591224944.1@sss.pgh.pa.us> Date: Wed, 03 Jun 2020 18:55:44 -0400 Message-ID: <1154086.1591224944@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Nolan writes: > Recently I was typing in a query in PG 10.4. > What I MEANT to type was: Where xyz >= 2400 > What I actually typed was: Where xyz >- 2400 > The latter was interpreted as 'where xyz > -2400', but I'm wondering if it > shouldn't have thrown an error on an unrecognized operator '>-' No, we do it that way intentionally, because the SQL standard requires us to parse such cases in this way. The CREATE OPERATOR man page has some details about what is and isn't a valid operator name ... and '>-' isn't one. (The rules there probably look a bit bizarre, but the intention is to ensure that operators found in the SQL spec can be parsed without requiring spaces between them.) regards, tom lane