pgsql: Fix updating of pg_subscription_rel from workers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix updating of pg_subscription_rel from workers
Date: 2017-06-07 17:54:50
Message-ID: E1dIfAQ-0007kv-EA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix updating of pg_subscription_rel from workers

A logical replication worker should not insert new rows into
pg_subscription_rel, only update existing rows, so that there are no
races if a concurrent refresh removes rows. Adjust the API to be able
to choose that behavior.

Author: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Reported-by: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/644ea35fc1352d845299563c7ddfb8b524ed27d9

Modified Files
--------------
src/backend/catalog/pg_subscription.c | 13 +++++++++----
src/backend/commands/subscriptioncmds.c | 4 ++--
src/backend/replication/logical/tablesync.c | 11 +++++++----
src/include/catalog/pg_subscription_rel.h | 2 +-
4 files changed, 19 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-06-07 19:49:18 pgsql: postgres_fdw: Allow cancellation of transaction control commands
Previous Message Robert Haas 2017-06-07 17:07:07 pgsql: Prevent BEFORE triggers from violating partitioning constraints.