diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-05-16 08:15:35 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-05-16 08:17:46 +0200 |
commit | 8aee330af55d8a759b2b73f5a771d9d34a7b887f (patch) | |
tree | b917e26b4dbc6efa2a1c65124768d98eaf8fc92c /src/backend/utils/cache | |
parent | f6ebb418317a1e84be46e7e7b02a26d8c44984de (diff) | |
download | postgresql-8aee330af55d8a759b2b73f5a771d9d34a7b887f.tar.gz postgresql-8aee330af55d8a759b2b73f5a771d9d34a7b887f.zip |
Revert temporal primary keys and foreign keys
This feature set did not handle empty ranges correctly, and it's now
too late for PostgreSQL 17 to fix it.
The following commits are reverted:
6db4598fcb8 Add stratnum GiST support function
46a0cd4cefb Add temporal PRIMARY KEY and UNIQUE constraints
86232a49a43 Fix comment on gist_stratnum_btree
030e10ff1a3 Rename pg_constraint.conwithoutoverlaps to conperiod
a88c800deb6 Use daterange and YMD in without_overlaps tests instead of tsrange.
5577a71fb0c Use half-open interval notation in without_overlaps tests
34768ee3616 Add temporal FOREIGN KEY contraints
482e108cd38 Add test for REPLICA IDENTITY with a temporal key
c3db1f30cba doc: clarify PERIOD and WITHOUT OVERLAPS in CREATE TABLE
144c2ce0cc7 Fix ON CONFLICT DO NOTHING/UPDATE for temporal indexes
Discussion: https://www.postgresql.org/message-id/d0b64a7a-dfe4-4b84-a906-c7dedfa40a3e@eisentraut.org
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index e6072cbdd9e..cc9b0c6524f 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -5540,14 +5540,11 @@ RelationGetIdentityKeyBitmap(Relation relation) /* * RelationGetExclusionInfo -- get info about index's exclusion constraint * - * This should be called only for an index that is known to have an associated - * exclusion constraint or primary key/unique constraint using WITHOUT - * OVERLAPS. - - * It returns arrays (palloc'd in caller's context) of the exclusion operator - * OIDs, their underlying functions' OIDs, and their strategy numbers in the - * index's opclasses. We cache all this information since it requires a fair - * amount of work to get. + * This should be called only for an index that is known to have an + * associated exclusion constraint. It returns arrays (palloc'd in caller's + * context) of the exclusion operator OIDs, their underlying functions' + * OIDs, and their strategy numbers in the index's opclasses. We cache + * all this information since it requires a fair amount of work to get. */ void RelationGetExclusionInfo(Relation indexRelation, @@ -5611,10 +5608,7 @@ RelationGetExclusionInfo(Relation indexRelation, int nelem; /* We want the exclusion constraint owning the index */ - if ((conform->contype != CONSTRAINT_EXCLUSION && - !(conform->conperiod && ( - conform->contype == CONSTRAINT_PRIMARY - || conform->contype == CONSTRAINT_UNIQUE))) || + if (conform->contype != CONSTRAINT_EXCLUSION || conform->conindid != RelationGetRelid(indexRelation)) continue; |