aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-05-08 15:24:48 +0200
committerPeter Eisentraut <peter@eisentraut.org>2024-05-08 15:24:48 +0200
commit482e108cd38db5366c52a6b1f4180f34c1796155 (patch)
tree227b3c60637573cc367a64c63d74f3aeb9c1ff75 /src
parent84f08f2215754cd03feaa82bbdf10fc114458b26 (diff)
downloadpostgresql-482e108cd38db5366c52a6b1f4180f34c1796155.tar.gz
postgresql-482e108cd38db5366c52a6b1f4180f34c1796155.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/without_overlaps.out4
-rw-r--r--src/test/regress/sql/without_overlaps.sql4
2 files changed, 8 insertions, 0 deletions
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
--