From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | KES <kes-kes(at)yandex(dot)ru> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Typo in doc or wrong EXCLUDE implementation |
Date: | 2018-08-09 19:09:13 |
Message-ID: | 20180809190913.GB14011@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs pgsql-hackers |
On Thu, Aug 9, 2018 at 01:11:05PM +0300, KES wrote:
> Bruce:
> >Yes, it would work, but doing that only for equality would be
> >surprising
> to many people
>
> Why surprising? It is
> [documented](https://www.postgresql.org/docs/current/static/sql-create
> table.html#sql-createtable-exclude):
> >If all of the specified operators test for equality, this is
> >equivalent to a UNIQUE constraint, although an ordinary unique
> >constraint will be faster.
>
> Thus the UNIQUE constraint is just particular case of exclusion
> constraint, is not?
Well, for me a UNIQUE constraint guarantees each discrete value is
unique, while exclusion constraint says discrete or ranges or geometric
types don't overlap. I realize equality is a special case of discrete,
but having such cases be marked as UNIQUE seems too confusing.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2018-08-09 19:31:09 | Re: Typo in doc or wrong EXCLUDE implementation |
Previous Message | Bruce Momjian | 2018-08-09 17:29:50 | Re: Doc update |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2018-08-09 19:31:09 | Re: Typo in doc or wrong EXCLUDE implementation |
Previous Message | Bruce Momjian | 2018-08-09 19:04:43 | Re: POC for a function trust mechanism |