Re: Typo in doc or wrong EXCLUDE implementation

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>, 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 21:35:56
Message-ID: 88d31bc1-575f-db25-2a2e-53f8a52f99e2@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On 09/08/18 21:09, Bruce Momjian wrote:
> 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.

One of the things I'm currently trying to implement is the WITHOUT
OVERLAPS for UNIQUE constraints.

See SQL:2016 section 11.7 <unique constraint definition>
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2018-08-09 23:38:43 Release note trimming: another modest proposal
Previous Message David G. Johnston 2018-08-09 20:15:08 Re: Typo in doc or wrong EXCLUDE implementation

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-08-09 21:46:10 Re: PATCH: pgbench - option to build using ppoll() for larger connection counts
Previous Message Nico Williams 2018-08-09 21:35:01 Re: [FEATURE REQUEST] Encrypted indexes over encrypted data