Re: [HACKERS] Idea on how to simplify comparing two sets - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] Idea on how to simplify comparing two sets
Date
Msg-id CAKFQuwZqUEkfpXQsMnYBGKb24h3TCXoTToA63BQr3EcMwx5uuQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Idea on how to simplify comparing two sets  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Idea on how to simplify comparing two sets
List pgsql-hackers
On Tue, Feb 7, 2017 at 8:58 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Joel Jacobson <joel@trustly.com> writes:
> Currently there is no simple way to check if two sets are equal.

Uh ... maybe check whether SELECT set1 EXCEPT SELECT set2
and SELECT set2 EXCEPT SELECT set1 are both empty?

​SELECT set1 FULL EXCEPT SELECT set2 ?

Matches with the concept and syntax of "FULL JOIN"​.

or

SELECT set1 XOR SELECT set2

That said I'm not sure how much we want to go down this road on our own.  It'd be nice to have when its needed but its not something that gets much visibility on these lists to suggest a large pent-up demand.

IS NOT DISTINCT FROM doesn't imply bi-direction any better than EXCEPT does ... if we are going to add new syntax I'd say it should at least do that.

David J.

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] Press Release Draft - 2016-02-09 Cumulative Update
Next
From: Erik Rijkers
Date:
Subject: Re: [HACKERS] Cache Hash Index meta page.