Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
Date
Msg-id 2433.1572114229@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'  (Andres Freund <andres@anarazel.de>)
Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'  (Eugen Konkov <kes-kes@yandex.ru>)
List pgsql-hackers
I wrote:
> We do have some unresolved issues around how to let dump/restore
> control the interpretation of IS [NOT] DISTINCT FROM, cf
> https://www.postgresql.org/message-id/flat/ffefc172-a487-aa87-a0e7-472bf29735c8%40gmail.com
> but I don't think this idea is helping with that at all.

BTW, taking a step back and viewing this suggestion as "it'd be nice
to have *some* shorter notation than IS [NOT] DISTINCT FROM", maybe
there's a way to unify that desire with the dump/restore fix.  What
we'd really need to fix the dump/restore problem, AFAICS, is to name
the underlying equality operator --- potentially with a schema
qualification --- but then have some notation that says "handle NULLs
like IS [NOT] DISTINCT FROM does".  So instead of

    x IS NOT DISTINCT FROM y

I'm vaguely imagining

    x = {magic} y

where unlike Eugen's suggestion, "=" is the real name of the underlying
comparison operator.  For dump/restore this could be spelled verbosely
as

    x OPERATOR(someplace.=) {magic} y

The hard part is to figure out some {magic} annotation that is both
short and unambiguous.  We have to cover the IS DISTINCT variant, too.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: define bool in pgtypeslib_extern.h
Next
From: Andrew Gierth
Date:
Subject: Re: define bool in pgtypeslib_extern.h