Skip to content

Commit 482e108

Browse files
committed
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
1 parent 84f08f2 commit 482e108

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/test/regress/expected/without_overlaps.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ SELECT * FROM tp2 ORDER BY id, valid_at;
448448
(1 row)
449449

450450
DROP TABLE temporal_partitioned;
451+
-- ALTER TABLE REPLICA IDENTITY
452+
-- (should fail)
453+
ALTER TABLE temporal_rng REPLICA IDENTITY USING INDEX temporal_rng_pk;
454+
ERROR: cannot use non-unique index "temporal_rng_pk" as replica identity
451455
--
452456
-- test FK dependencies
453457
--

src/test/regress/sql/without_overlaps.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ SELECT * FROM tp1 ORDER BY id, valid_at;
315315
SELECT * FROM tp2 ORDER BY id, valid_at;
316316
DROP TABLE temporal_partitioned;
317317

318+
-- ALTER TABLE REPLICA IDENTITY
319+
-- (should fail)
320+
ALTER TABLE temporal_rng REPLICA IDENTITY USING INDEX temporal_rng_pk;
321+
318322
--
319323
-- test FK dependencies
320324
--

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy