Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
Дата
Msg-id 27329.1572277298@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'  (Diggory Blake <diggsey@googlemail.com>)
Список pgsql-hackers
Diggory Blake <diggsey@googlemail.com> writes:
> Would it be possible to just use `IS`, `IS NOT` instead of `IS [NOT]
> DISTINCT FROM`? It's always surprised me that you can write `IS NULL`, `IS
> TRUE`, etc. but they're all special-cased. I could see it introducing a
> parsing ambiguity, but it doesn't seem impossible to resolve?

Cute idea, but I'm afraid it breaks down when you come to
"x IS DOCUMENT".  We'd have to make DOCUMENT fully reserved
(or at least more reserved --- maybe type_func_name_keyword
would be enough?) or it'd be unclear whether that meant a
not-distinct comparison to a column named "document".
And I'd bet a lot that there are people out there with
columns named "document", so even type_func_name_keyword
reserved-ness would be enough to break their applications.

In the bigger picture, even if we were okay with that, I'm
afraid that we'd constantly be in danger of the SQL committee
adding some new "x IS KEYWORD(s)" test, causing new problems.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
Следующее
От: Robert Haas
Дата:
Сообщение: Re: strpos behavior change around empty substring in PG12