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 <[email protected]>
Reviewed-by: Euler Taveira <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/flat/[email protected]

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2f0dd9d93efe0d2e41585f804a38b2db5b7f429d

Modified Files
--------------
src/backend/commands/tablecmds.c               | 42 +++++++++++++++++++++++
src/backend/utils/cache/lsyscache.c            | 25 ++++++++++++++
src/include/utils/lsyscache.h                  |  1 +
src/test/regress/expected/replica_identity.out | 46 ++++++++++++++++++++++++++
src/test/regress/sql/replica_identity.sql      | 21 ++++++++++++
5 files changed, 135 insertions(+)

Reply via email to