pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Preserve replica identity index across ALTER TABLE rewrite
Date: Fri, 13 Mar 2020 12:31:44 +0000
Message-ID: <E1jCjTc-0007E3-Bi@gemulon.postgresql.org> (raw)

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15cbbf81a58fd04479c0e5ff134838492473e935

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(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1jCjTc-0007E3-Bi@gemulon.postgresql.org>
Permalink:  ../E1jCjTc-0007E3-Bi@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jCjTc-0007E3-Bi@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Preserve replica identity index across ALTER TABLE rewrite
  In-Reply-To: <E1jCjTc-0007E3-Bi@gemulon.postgresql.org>
  References: <E1jCjTc-0007E3-Bi@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox