pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
EXCLUDE logical wording: "not all" should be "none"
2+ messages / 2 participants
[nested] [flat]

* EXCLUDE logical wording: "not all" should be "none"
@ 2017-03-06 10:39  nick.rutherford@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: nick.rutherford@gmail.com @ 2017-03-06 10:39 UTC (permalink / raw)
  To: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.6/static/sql-createtable.html
Description:

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.

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: EXCLUDE logical wording: "not all" should be "none"
@ 2017-03-07 01:50  Tom Lane <tgl@sss.pgh.pa.us>
  parent: nick.rutherford@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-03-07 01:50 UTC (permalink / raw)
  To: nick.rutherford@gmail.com; +Cc: pgsql-docs

nick.rutherford@gmail.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


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-03-07 01:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 10:39 EXCLUDE logical wording: "not all" should be "none" nick.rutherford@gmail.com
2017-03-07 01:50 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox