Add temporal PRIMARY KEY and UNIQUE constraints
authorPeter Eisentraut <[email protected]>
Wed, 24 Jan 2024 14:43:41 +0000 (15:43 +0100)
committerPeter Eisentraut <[email protected]>
Wed, 24 Jan 2024 15:34:37 +0000 (16:34 +0100)
commit46a0cd4cefb4d9b462d8cc4df5e7ecdd190bea92
treeccbcef511474ad69dd7472f0a35fe7813e47d909
parent74a73063106583b1f49274a2cd1df42e35107361
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 <[email protected]>
Reviewed-by: Peter Eisentraut <[email protected]>
Reviewed-by: jian he <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com
34 files changed:
contrib/btree_gist/Makefile
contrib/btree_gist/expected/without_overlaps.out [new file with mode: 0644]
contrib/btree_gist/meson.build
contrib/btree_gist/sql/without_overlaps.sql [new file with mode: 0644]
doc/src/sgml/catalogs.sgml
doc/src/sgml/gist.sgml
doc/src/sgml/ref/create_table.sgml
src/backend/access/gist/gistutil.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/pg_constraint.c
src/backend/commands/indexcmds.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/commands/typecmds.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/parser/gram.y
src/backend/parser/parse_utilcmd.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/cache/relcache.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/psql/describe.c
src/include/access/gist.h
src/include/catalog/catversion.h
src/include/catalog/index.h
src/include/catalog/pg_constraint.h
src/include/commands/defrem.h
src/include/nodes/parsenodes.h
src/test/regress/expected/without_overlaps.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/without_overlaps.sql [new file with mode: 0644]