Skip to content

Commit 8aee330

Browse files
committed
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: 6db4598 Add stratnum GiST support function 46a0cd4 Add temporal PRIMARY KEY and UNIQUE constraints 86232a4 Fix comment on gist_stratnum_btree 030e10f Rename pg_constraint.conwithoutoverlaps to conperiod a88c800 Use daterange and YMD in without_overlaps tests instead of tsrange. 5577a71 Use half-open interval notation in without_overlaps tests 34768ee Add temporal FOREIGN KEY contraints 482e108 Add test for REPLICA IDENTITY with a temporal key c3db1f3 doc: clarify PERIOD and WITHOUT OVERLAPS in CREATE TABLE 144c2ce Fix ON CONFLICT DO NOTHING/UPDATE for temporal indexes Discussion: https://www.postgresql.org/message-id/d0b64a7a-dfe4-4b84-a906-c7dedfa40a3e@eisentraut.org
1 parent f6ebb41 commit 8aee330

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+149
-4475
lines changed

‎contrib/btree_gist/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ EXTENSION = btree_gist
3333
DATA = btree_gist--1.0--1.1.sql \
3434
btree_gist--1.1--1.2.sql btree_gist--1.2.sql btree_gist--1.2--1.3.sql \
3535
btree_gist--1.3--1.4.sql btree_gist--1.4--1.5.sql \
36-
btree_gist--1.5--1.6.sql btree_gist--1.6--1.7.sql \
37-
btree_gist--1.7--1.8.sql
36+
btree_gist--1.5--1.6.sql btree_gist--1.6--1.7.sql
3837
PGFILEDESC = "btree_gist - B-tree equivalent GiST operator classes"
3938

4039
REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz \
4140
time timetz date interval macaddr macaddr8 inet cidr text varchar char \
42-
bytea bit varbit numeric uuid not_equal enum bool partitions \
43-
stratnum without_overlaps
41+
bytea bit varbit numeric uuid not_equal enum bool partitions
4442

4543
SHLIB_LINK += $(filter -lm, $(LIBS))
4644

‎contrib/btree_gist/btree_gist--1.7--1.8.sql

-87
This file was deleted.

‎contrib/btree_gist/btree_gist.c

-27
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
*/
44
#include "postgres.h"
55

6-
#include "access/stratnum.h"
76
#include "utils/builtins.h"
87

98
PG_MODULE_MAGIC;
109

1110
PG_FUNCTION_INFO_V1(gbt_decompress);
1211
PG_FUNCTION_INFO_V1(gbtreekey_in);
1312
PG_FUNCTION_INFO_V1(gbtreekey_out);
14-
PG_FUNCTION_INFO_V1(gist_stratnum_btree);
1513

1614
/**************************************************
1715
* In/Out for keys
@@ -53,28 +51,3 @@ gbt_decompress(PG_FUNCTION_ARGS)
5351
{
5452
PG_RETURN_POINTER(PG_GETARG_POINTER(0));
5553
}
56-
57-
/*
58-
* Returns the btree number for supported operators, otherwise invalid.
59-
*/
60-
Datum
61-
gist_stratnum_btree(PG_FUNCTION_ARGS)
62-
{
63-
StrategyNumber strat = PG_GETARG_UINT16(0);
64-
65-
switch (strat)
66-
{
67-
case RTEqualStrategyNumber:
68-
PG_RETURN_UINT16(BTEqualStrategyNumber);
69-
case RTLessStrategyNumber:
70-
PG_RETURN_UINT16(BTLessStrategyNumber);
71-
case RTLessEqualStrategyNumber:
72-
PG_RETURN_UINT16(BTLessEqualStrategyNumber);
73-
case RTGreaterStrategyNumber:
74-
PG_RETURN_UINT16(BTGreaterStrategyNumber);
75-
case RTGreaterEqualStrategyNumber:
76-
PG_RETURN_UINT16(BTGreaterEqualStrategyNumber);
77-
default:
78-
PG_RETURN_UINT16(InvalidStrategy);
79-
}
80-
}

‎contrib/btree_gist/btree_gist.control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# btree_gist extension
22
comment = 'support for indexing common datatypes in GiST'
3-
default_version = '1.8'
3+
default_version = '1.7'
44
module_pathname = '$libdir/btree_gist'
55
relocatable = true
66
trusted = true

‎contrib/btree_gist/expected/stratnum.out

-13
This file was deleted.

‎contrib/btree_gist/expected/without_overlaps.out

-92
This file was deleted.

‎contrib/btree_gist/meson.build

-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ install_data(
5050
'btree_gist--1.4--1.5.sql',
5151
'btree_gist--1.5--1.6.sql',
5252
'btree_gist--1.6--1.7.sql',
53-
'btree_gist--1.7--1.8.sql',
5453
kwargs: contrib_data_args,
5554
)
5655

@@ -90,8 +89,6 @@ tests += {
9089
'enum',
9190
'bool',
9291
'partitions',
93-
'stratnum',
94-
'without_overlaps',
9592
],
9693
},
9794
}

‎contrib/btree_gist/sql/stratnum.sql

-3
This file was deleted.

‎contrib/btree_gist/sql/without_overlaps.sql

-53
This file was deleted.

‎doc/src/sgml/catalogs.sgml

-11
Original file line numberDiff line numberDiff line change
@@ -2729,17 +2729,6 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
27292729
</para></entry>
27302730
</row>
27312731

2732-
<row>
2733-
<entry role="catalog_table_entry"><para role="column_definition">
2734-
<structfield>conperiod</structfield> <type>bool</type>
2735-
</para>
2736-
<para>
2737-
This constraint is defined with <literal>WITHOUT OVERLAPS</literal>
2738-
(for primary keys and unique constraints) or <literal>PERIOD</literal>
2739-
(for foreign keys).
2740-
</para></entry>
2741-
</row>
2742-
27432732
<row>
27442733
<entry role="catalog_table_entry"><para role="column_definition">
27452734
<structfield>conkey</structfield> <type>int2[]</type>

0 commit comments

Comments
 (0)