File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Original file line number Diff line number Diff line change @@ -1538,6 +1538,10 @@ index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
1538
1538
newIndexForm -> indimmediate = oldIndexForm -> indimmediate ;
1539
1539
oldIndexForm -> indimmediate = true;
1540
1540
1541
+ /* Preserve indisreplident in the new index */
1542
+ newIndexForm -> indisreplident = oldIndexForm -> indisreplident ;
1543
+ oldIndexForm -> indisreplident = false;
1544
+
1541
1545
/* Preserve indisclustered in the new index */
1542
1546
newIndexForm -> indisclustered = oldIndexForm -> indisclustered ;
1543
1547
Original file line number Diff line number Diff line change @@ -2141,6 +2141,27 @@ SELECT indexrelid::regclass, indisclustered FROM pg_index
2141
2141
(1 row)
2142
2142
2143
2143
DROP TABLE concur_clustered;
2144
+ -- Check that indisreplident updates are preserved.
2145
+ CREATE TABLE concur_replident(i int NOT NULL);
2146
+ CREATE UNIQUE INDEX concur_replident_i_idx ON concur_replident(i);
2147
+ ALTER TABLE concur_replident REPLICA IDENTITY
2148
+ USING INDEX concur_replident_i_idx;
2149
+ SELECT indexrelid::regclass, indisreplident FROM pg_index
2150
+ WHERE indrelid = 'concur_replident'::regclass;
2151
+ indexrelid | indisreplident
2152
+ ------------------------+----------------
2153
+ concur_replident_i_idx | t
2154
+ (1 row)
2155
+
2156
+ REINDEX TABLE CONCURRENTLY concur_replident;
2157
+ SELECT indexrelid::regclass, indisreplident FROM pg_index
2158
+ WHERE indrelid = 'concur_replident'::regclass;
2159
+ indexrelid | indisreplident
2160
+ ------------------------+----------------
2161
+ concur_replident_i_idx | t
2162
+ (1 row)
2163
+
2164
+ DROP TABLE concur_replident;
2144
2165
-- Partitions
2145
2166
-- Create some partitioned tables
2146
2167
CREATE TABLE concur_reindex_part (c1 int, c2 int) PARTITION BY RANGE (c1);
Original file line number Diff line number Diff line change @@ -866,6 +866,17 @@ REINDEX TABLE CONCURRENTLY concur_clustered;
866
866
SELECT indexrelid::regclass, indisclustered FROM pg_index
867
867
WHERE indrelid = ' concur_clustered' ::regclass;
868
868
DROP TABLE concur_clustered;
869
+ -- Check that indisreplident updates are preserved.
870
+ CREATE TABLE concur_replident (i int NOT NULL );
871
+ CREATE UNIQUE INDEX concur_replident_i_idx ON concur_replident(i);
872
+ ALTER TABLE concur_replident REPLICA IDENTITY
873
+ USING INDEX concur_replident_i_idx;
874
+ SELECT indexrelid::regclass, indisreplident FROM pg_index
875
+ WHERE indrelid = ' concur_replident' ::regclass;
876
+ REINDEX TABLE CONCURRENTLY concur_replident;
877
+ SELECT indexrelid::regclass, indisreplident FROM pg_index
878
+ WHERE indrelid = ' concur_replident' ::regclass;
879
+ DROP TABLE concur_replident;
869
880
870
881
-- Partitions
871
882
-- Create some partitioned tables
You can’t perform that action at this time.
0 commit comments