Re: EXCLUDE logical wording: "not all" should be "none"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nick(dot)rutherford(at)gmail(dot)com
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: EXCLUDE logical wording: "not all" should be "none"
Date: 2017-03-07 01:50:22
Message-ID: 1040.1488851422@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

nick(dot)rutherford(at)gmail(dot)com writes:
> The EXCLUDE docs say

> "The EXCLUDE clause defines an exclusion constraint, which guarantees that
> if any two rows are compared on the specified column(s) or expression(s)
> using the specified operator(s), not all of these comparisons will return
> TRUE."

> It also says "for equality, this is equivalent to a UNIQUE constraint".

> The current documentation saying "not all" is not the same as a unique
> constraint, because in the case of equality, it is logically stating that
> "All rows - 1 can be equal", which satisfies "not all" pairs. Instead it
> should say that no pairs, or none, return true.

Hmm. I think what that text means by "not all of these comparisons" is
"not all of these column comparisons", whereas you seem to be reading it
as talking about comparison of the whole row to all other rows in the
table. Am I misunderstanding your point?

(I agree that this text could use improvement, but your proposed edit
seems wrong in detail. The quantifier across the whole table is already
there in the bit about "if any two rows".)

regards, tom lane

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message mnikulyak 2017-03-07 20:57:21 Should the cartesian product be more easily seen?
Previous Message finzelj 2017-03-06 14:36:24 Grammar error