Add test for REPLICA IDENTITY with a temporal key

You can only use REPLICA IDENTITY USING INDEX with a unique B-tree
index.  This commit just adds a test showing that you cannot use it
with a WITHOUT OVERLAPS index (which is GiST).

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Discussion: https://www.postgresql.org/message-id/3775839b-3f0f-4c8a-ac03-a253222e6a4b%40illuminatedcomputing.com
This commit is contained in:
Peter Eisentraut 2024-05-08 15:24:48 +02:00
parent 84f08f2215
commit 482e108cd3
2 changed files with 8 additions and 0 deletions

View File

@ -448,6 +448,10 @@ SELECT * FROM tp2 ORDER BY id, valid_at;
(1 row)
DROP TABLE temporal_partitioned;
-- ALTER TABLE REPLICA IDENTITY
-- (should fail)
ALTER TABLE temporal_rng REPLICA IDENTITY USING INDEX temporal_rng_pk;
ERROR: cannot use non-unique index "temporal_rng_pk" as replica identity
--
-- test FK dependencies
--

View File

@ -315,6 +315,10 @@ SELECT * FROM tp1 ORDER BY id, valid_at;
SELECT * FROM tp2 ORDER BY id, valid_at;
DROP TABLE temporal_partitioned;
-- ALTER TABLE REPLICA IDENTITY
-- (should fail)
ALTER TABLE temporal_rng REPLICA IDENTITY USING INDEX temporal_rng_pk;
--
-- test FK dependencies
--