pgsql: Preserve replica identity index across ALTER TABLE rewrite

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Preserve replica identity index across ALTER TABLE rewrite
Date: 2020-03-13 12:31:44
Message-ID: E1jCjTc-0007E0-BK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reviewed-by: Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/c70fcab2-4866-0d9f-1d01-e75e189db342(at)gmail(dot)com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c9ef507e82ebb2bffc50e531edd6fb4593dd5146

Modified Files
--------------
src/backend/commands/tablecmds.c | 42 +++++++++++++++++++++++
src/backend/utils/cache/lsyscache.c | 23 +++++++++++++
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, 133 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2020-03-13 13:28:37 pgsql: Unify several ways to tracking backend type
Previous Message Michael Paquier 2020-03-13 06:12:02 pgsql: Refactor compile-time assertion checks in c.h