From 46a0cd4cefb4d9b462d8cc4df5e7ecdd190bea92 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 24 Jan 2024 15:43:41 +0100 Subject: Add temporal PRIMARY KEY and UNIQUE constraints Add WITHOUT OVERLAPS clause to PRIMARY KEY and UNIQUE constraints. These are backed by GiST indexes instead of B-tree indexes, since they are essentially exclusion constraints with = for the scalar parts of the key and && for the temporal part. Author: Paul A. Jungwirth Reviewed-by: Peter Eisentraut Reviewed-by: jian he Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com --- doc/src/sgml/gist.sgml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/src/sgml/gist.sgml') diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml index 7c20f8467b4..8a19f156d83 100644 --- a/doc/src/sgml/gist.sgml +++ b/doc/src/sgml/gist.sgml @@ -298,7 +298,8 @@ CREATE INDEX ON my_table USING GIST (my_inet_column inet_ops); The optional twelfth method stratnum is used to translate well-known RT*StrategyNumbers (from src/include/access/stratnum.h) into strategy numbers - used by the operator class. + used by the operator class. This lets the core code look up operators for + temporal constraint indexes. @@ -1185,6 +1186,17 @@ my_sortsupport(PG_FUNCTION_ARGS) operator class has no matching strategy. + + This is used for temporal index constraints (i.e., PRIMARY + KEY and UNIQUE). If the operator class + provides this function and it returns results for + RTEqualStrategyNumber, it can be used in the + non-WITHOUT OVERLAPS part(s) of an index constraint. + If it returns results for RTOverlapStrategyNumber, + the operator class can be used in the WITHOUT + OVERLAPS part of an index constraint. + + The SQL declaration of the function must look like this: -- cgit v1.2.3