Preserve replica identity index across ALTER TABLE rewrite
Peter Eisentraut <peter@eisentraut.org>
Preserve replica identity index across ALTER TABLE rewrite If an index was explicitly set as replica identity index, this setting was lost when a table was rewritten by ALTER TABLE. Because this setting is part of pg_index but actually controlled by ALTER TABLE (not part of CREATE INDEX, say), we have to do some extra work to restore it. Based-on-patch-by: Quan Zongliang <quanzongliang@gmail.com> Reviewed-by: Euler Taveira <euler.taveira@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/flat/c70fcab2-4866-0d9f-1d01-e75e189db342@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +42 −0 |
| src/backend/utils/cache/lsyscache.c | modified | +25 −0 |
| src/include/utils/lsyscache.h | modified | +1 −0 |
| src/test/regress/expected/replica_identity.out | modified | +46 −0 |
| src/test/regress/sql/replica_identity.sql | modified | +21 −0 |
Discussion
- Restore replication settings when modifying a field type 11 messages · 2019-10-26 → 2020-03-13