pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Nolan <htfoot@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: A parsing question
Date: Wed, 03 Jun 2020 18:55:44 -0400
Message-ID: <1154086.1591224944@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOzAqu+0zfJ4235Mp3ssMcp4VH57rk9xhw44Lg4MrA1YtG2YNw@mail.gmail.com>
References: <CAOzAqu+0zfJ4235Mp3ssMcp4VH57rk9xhw44Lg4MrA1YtG2YNw@mail.gmail.com>

Michael Nolan <htfoot@gmail.com> 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





view thread (3+ messages)

Message-ID: <1154086.1591224944@sss.pgh.pa.us>
Permalink:  ../1154086.1591224944@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1154086.1591224944@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, htfoot@gmail.com
  Subject: Re: A parsing question
  In-Reply-To: <1154086.1591224944@sss.pgh.pa.us>
  References: <CAOzAqu+0zfJ4235Mp3ssMcp4VH57rk9xhw44Lg4MrA1YtG2YNw@mail.gmail.com> <1154086.1591224944@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox