Re: IS as a binary operator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: IS as a binary operator
Дата
Msg-id 1179563.1677344075@sss.pgh.pa.us
обсуждение исходный текст
Ответ на IS as a binary operator  (david wheeler <hippysoyboy@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: david wheeler
Дата:
Сообщение: IS as a binary operator
Следующее
От: "jacktby@gmail.com"
Дата:
Сообщение: Give me details of some attributes!!