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

From Eugen Konkov
Subject Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
Date
Msg-id 1627344878.20191028133938@yandex.ru
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'
Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
List pgsql-hackers
>         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.

I  am  from  Perl  world.  There  are  == and != operators.
Here short snippet of code:

my $x = undef;
my $y = 'some value';
my $z = undef;
$x == $y; # FALSE
$x == $z; # TRUE
$x != $y ; # TRUE
$x != $z;  # FALSE


>         x OPERATOR(someplace.=) {magic} y
If we should follow this form, then IS DISTINCT should be written as:
x =! y
This  looks unusual, because JavaScript also follow != form. so I hope
it  will be easy to detect/implement != form, which I used to read as:
negate the result of comparison



Can   we   supply   additional   parameters  to  OPERATOR  via  double
parentheses( double parentheses is another crazy idea)?
x =(( 'NULL' )) y

or

x OPERATOR(someplace.=, magic ) y
which   will  be  internally  converted(  I  suppose  )  to  OPERATOR(
someplace.=, x, y, magic )

-- 
Best regards,
Eugen Konkov




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Connections hang indefinitely while taking a gin index's LWLockbuffer_content lock(PG10.7)
Next
From: Isaac Morland
Date:
Subject: Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'