From: Tom Lane <tgl@sss.pgh.pa.us>
To: david wheeler <hippysoyboy@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: IS as a binary operator
Date: Sat, 25 Feb 2023 11:54:35 -0500
Message-ID: <1179563.1677344075@sss.pgh.pa.us> (raw)
In-Reply-To: <4996BD98-0349-4871-B952-AFD8261920D0@gmail.com>
References: <4996BD98-0349-4871-B952-AFD8261920D0@gmail.com>
david wheeler <hippysoyboy@gmail.com> writes:
> I guess there’s no interest in adding support for `IS` as basically an alias for `IS NOT DISTINCT FROM`? (and `IS NOT` for `IS DISTINCT FROM`)
Seems like it'd be impossibly ambiguous with the various sorts of
"x IS FOO" constructs that SQL keeps adding. We'd have to make
all the FOO keywords fully reserved, which would break people's
queries for sure. (Things like CONTENT, DOCUMENT, NORMALIZED,
and NFC are unreserved at the moment; and at least the first
two of those are pretty plausible as user column names.)
Another problem is that currently IS is a type_func_name_keyword,
which makes things like this syntactically valid:
regression=# select is(42);
ERROR: function is(integer) does not exist
I doubt we could preserve that in the face of what you suggest.
Maybe no one would care, but ...
On the whole, I'm afraid of what sorts of "IS" constructs might
come out of the committee in future, and what sort of hard place
we might find ourselves in if we allow "IS" to not be followed
by one of a small set of known keyword sequences.
It is a shame that there's nothing less verbose than
"IS NOT DISTINCT FROM" for what is surely a pretty common
requirement. But we probably need to get the SQL committee
on board with any replacement syntax for that.
regards, tom lane
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, hippysoyboy@gmail.com
Subject: Re: IS as a binary operator
In-Reply-To: <1179563.1677344075@sss.pgh.pa.us>
References: <4996BD98-0349-4871-B952-AFD8261920D0@gmail.com> <1179563.1677344075@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