Re: IS as a binary operator - Mailing list pgsql-general

From Tom Lane
Subject Re: IS as a binary operator
Date
Msg-id 1179563.1677344075@sss.pgh.pa.us
Whole thread Raw
In response to IS as a binary operator  (david wheeler <hippysoyboy@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: david wheeler
Date:
Subject: IS as a binary operator
Next
From: "jacktby@gmail.com"
Date:
Subject: Give me details of some attributes!!