Re: Typo in doc or wrong EXCLUDE implementation

2018-08-10 Thread KES
huh, maybe you are right, I missread that. English is not my native language. Actually I come there from FK constraints. Would it be sufficient for FK require not UNIQUEs, but **allow** "EXCLUDE with operators that act like equality"? 09.08.2018, 22:31, "Tom Lane" : > Bruce Momjian writes: >>

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Vik Fearing
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-

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread David G. Johnston
On Thu, Aug 9, 2018 at 12:31 PM, Tom Lane wrote: > I think the OP is reading "equivalent" literally, as meaning that > an EXCLUDE with operators that act like equality is treated as being > the same as UNIQUE for *every* purpose. We're not going there, IMO, > so probably we need to tweak the doc

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Tom Lane
Bruce Momjian writes: > On Thu, Aug 9, 2018 at 01:11:05PM +0300, KES wrote: >> 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

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread Bruce Momjian
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): > >

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-09 Thread KES
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-createtable.html#sql-createtable-exclude): >If all of the specified operators test for equality, this is equivale

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-08 Thread Alvaro Herrera
On 2018-Aug-08, KES wrote: > I do not know many internals and maybe wrong. > > But from my point of view with my current knowledge. > If such exclusion constraint would be marked as UNIQUE we can use it for FK > while implementing temporal/bi-temporal tables. > > And this will be simplify rela

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-08 Thread KES
I do not know many internals and maybe wrong. But from my point of view with my current knowledge. If such exclusion constraint would be marked as UNIQUE we can use it for FK while implementing temporal/bi-temporal tables. And this will be simplify relationing while implementing them. 07.08.20

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-08 Thread Tom Lane
Bruce Momjian writes: > On Wed, Aug 8, 2018 at 01:55:53PM +0300, KES wrote: >> If such exclusion constraint would be marked as UNIQUE we can use it for FK >> while implementing temporal/bi-temporal tables. > Yes, it would work, but doing that only for equality would be surprising > to many peop

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-08 Thread Bruce Momjian
On Wed, Aug 8, 2018 at 01:55:53PM +0300, KES wrote: > I do not know many internals and maybe wrong. > > But from my point of view with my current knowledge. > If such exclusion constraint would be marked as UNIQUE we can use it for FK > while implementing temporal/bi-temporal tables. > > And t

Re: Typo in doc or wrong EXCLUDE implementation

2018-08-07 Thread Bruce Momjian
This email was sent to docs, but I think it is a hackers issue. The person is asking why exclusion constraints aren't marked as UNIQUE indexes that can be used for referential integrity. I think the reason is that non-equality exclusion constraints, like preventing overlap, but don't uniquely i