aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/replica_identity.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/replica_identity.out')
-rw-r--r--src/test/regress/expected/replica_identity.out37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/regress/expected/replica_identity.out b/src/test/regress/expected/replica_identity.out
index e25ec06a842..7d798ef2a5b 100644
--- a/src/test/regress/expected/replica_identity.out
+++ b/src/test/regress/expected/replica_identity.out
@@ -227,7 +227,44 @@ Indexes:
-- used as replica identity.
ALTER TABLE test_replica_identity3 ALTER COLUMN id DROP NOT NULL;
ERROR: column "id" is in index used as replica identity
+--
+-- Test that replica identity can be set on an index that's not yet valid.
+-- (This matches the way pg_dump will try to dump a partitioned table.)
+--
+CREATE TABLE test_replica_identity4(id integer NOT NULL) PARTITION BY LIST (id);
+CREATE TABLE test_replica_identity4_1(id integer NOT NULL);
+ALTER TABLE ONLY test_replica_identity4
+ ATTACH PARTITION test_replica_identity4_1 FOR VALUES IN (1);
+ALTER TABLE ONLY test_replica_identity4
+ ADD CONSTRAINT test_replica_identity4_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY test_replica_identity4
+ REPLICA IDENTITY USING INDEX test_replica_identity4_pkey;
+ALTER TABLE ONLY test_replica_identity4_1
+ ADD CONSTRAINT test_replica_identity4_1_pkey PRIMARY KEY (id);
+\d+ test_replica_identity4
+ Partitioned table "public.test_replica_identity4"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ id | integer | | not null | | plain | |
+Partition key: LIST (id)
+Indexes:
+ "test_replica_identity4_pkey" PRIMARY KEY, btree (id) INVALID REPLICA IDENTITY
+Partitions: test_replica_identity4_1 FOR VALUES IN (1)
+
+ALTER INDEX test_replica_identity4_pkey
+ ATTACH PARTITION test_replica_identity4_1_pkey;
+\d+ test_replica_identity4
+ Partitioned table "public.test_replica_identity4"
+ Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
+--------+---------+-----------+----------+---------+---------+--------------+-------------
+ id | integer | | not null | | plain | |
+Partition key: LIST (id)
+Indexes:
+ "test_replica_identity4_pkey" PRIMARY KEY, btree (id) REPLICA IDENTITY
+Partitions: test_replica_identity4_1 FOR VALUES IN (1)
+
DROP TABLE test_replica_identity;
DROP TABLE test_replica_identity2;
DROP TABLE test_replica_identity3;
+DROP TABLE test_replica_identity4;
DROP TABLE test_replica_identity_othertable;