You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Add WITHOUT OVERLAPS clause to PRIMARY KEY and UNIQUE constraints.These are backed by GiST indexes instead of B-tree indexes, since theyare essentially exclusion constraints with = for the scalar parts ofthe key and && for the temporal part.(previously committed as46a0cd4, reverted by46a0cd4; the newpart is this:)Because 'empty' && 'empty' is false, the temporal PK/UQ constraintallowed duplicates, which is confusing to users and breaks internalexpectations. For instance, when GROUP BY checks functionaldependencies on the PK, it allows selecting other columns from thetable, but in the presence of duplicate keys you could get the valuefrom any of their rows. So we need to forbid empties.This all means that at the moment we can only support ranges andmultiranges for temporal PK/UQs, unlike the original patch (above).Documentation and tests for this are added. But this couldconceivably be extended by introducing some more general support forthe notion of "empty" for other types.Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>Reviewed-by: Peter Eisentraut <peter@eisentraut.org>Reviewed-by: jian he <jian.universality@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com