forked from IvorySQL/IvorySQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IvorySQL#676 from jiaoshuntian/merge_pg_master2
Merge pg master from 2024.1.23 to 2024.2.14
- Loading branch information
Showing
462 changed files
with
21,481 additions
and
6,548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
-- Core must test WITHOUT OVERLAPS | ||
-- with an int4range + daterange, | ||
-- so here we do some simple tests | ||
-- to make sure int + daterange works too, | ||
-- since that is the expected use-case. | ||
CREATE TABLE temporal_rng ( | ||
id integer, | ||
valid_at daterange, | ||
CONSTRAINT temporal_rng_pk PRIMARY KEY (id, valid_at WITHOUT OVERLAPS) | ||
); | ||
\d temporal_rng | ||
Table "public.temporal_rng" | ||
Column | Type | Collation | Nullable | Default | ||
----------+-----------+-----------+----------+--------- | ||
id | integer | | not null | | ||
valid_at | daterange | | not null | | ||
Indexes: | ||
"temporal_rng_pk" PRIMARY KEY (id, valid_at WITHOUT OVERLAPS) | ||
|
||
SELECT pg_get_constraintdef(oid) FROM pg_constraint WHERE conname = 'temporal_rng_pk'; | ||
pg_get_constraintdef | ||
--------------------------------------------- | ||
PRIMARY KEY (id, valid_at WITHOUT OVERLAPS) | ||
(1 row) | ||
|
||
SELECT pg_get_indexdef(conindid, 0, true) FROM pg_constraint WHERE conname = 'temporal_rng_pk'; | ||
pg_get_indexdef | ||
------------------------------------------------------------------------------- | ||
CREATE UNIQUE INDEX temporal_rng_pk ON temporal_rng USING gist (id, valid_at) | ||
(1 row) | ||
|
||
INSERT INTO temporal_rng VALUES | ||
(1, '[2000-01-01,2001-01-01)'); | ||
-- same key, doesn't overlap: | ||
INSERT INTO temporal_rng VALUES | ||
(1, '[2001-01-01,2002-01-01)'); | ||
-- overlaps but different key: | ||
INSERT INTO temporal_rng VALUES | ||
(2, '[2000-01-01,2001-01-01)'); | ||
-- should fail: | ||
INSERT INTO temporal_rng VALUES | ||
(1, '[2000-06-01,2001-01-01)'); | ||
ERROR: conflicting key value violates exclusion constraint "temporal_rng_pk" | ||
DETAIL: Key (id, valid_at)=(1, [06-01-2000,01-01-2001)) conflicts with existing key (id, valid_at)=(1, [01-01-2000,01-01-2001)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,7 @@ tests += { | |
'bool', | ||
'partitions', | ||
'stratnum', | ||
'without_overlaps', | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Core must test WITHOUT OVERLAPS | ||
-- with an int4range + daterange, | ||
-- so here we do some simple tests | ||
-- to make sure int + daterange works too, | ||
-- since that is the expected use-case. | ||
CREATE TABLE temporal_rng ( | ||
id integer, | ||
valid_at daterange, | ||
CONSTRAINT temporal_rng_pk PRIMARY KEY (id, valid_at WITHOUT OVERLAPS) | ||
); | ||
\d temporal_rng | ||
SELECT pg_get_constraintdef(oid) FROM pg_constraint WHERE conname = 'temporal_rng_pk'; | ||
SELECT pg_get_indexdef(conindid, 0, true) FROM pg_constraint WHERE conname = 'temporal_rng_pk'; | ||
|
||
INSERT INTO temporal_rng VALUES | ||
(1, '[2000-01-01,2001-01-01)'); | ||
-- same key, doesn't overlap: | ||
INSERT INTO temporal_rng VALUES | ||
(1, '[2001-01-01,2002-01-01)'); | ||
-- overlaps but different key: | ||
INSERT INTO temporal_rng VALUES | ||
(2, '[2000-01-01,2001-01-01)'); | ||
-- should fail: | ||
INSERT INTO temporal_rng VALUES | ||
(1, '[2000-06-01,2001-01-01)'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.