From 482e108cd38db5366c52a6b1f4180f34c1796155 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 8 May 2024 15:24:48 +0200 Subject: [PATCH] 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 Discussion: https://www.postgresql.org/message-id/3775839b-3f0f-4c8a-ac03-a253222e6a4b%40illuminatedcomputing.com --- src/test/regress/expected/without_overlaps.out | 4 ++++ src/test/regress/sql/without_overlaps.sql | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/test/regress/expected/without_overlaps.out b/src/test/regress/expected/without_overlaps.out index f6fe8f09369..abc22d0113f 100644 --- a/src/test/regress/expected/without_overlaps.out +++ b/src/test/regress/expected/without_overlaps.out @@ -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 -- diff --git a/src/test/regress/sql/without_overlaps.sql b/src/test/regress/sql/without_overlaps.sql index da2b7f19a85..d4ae03ae529 100644 --- a/src/test/regress/sql/without_overlaps.sql +++ b/src/test/regress/sql/without_overlaps.sql @@ -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 -- -- 2.30.2