1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Add option to modify sync commit per subscription

This also changes default behaviour of subscription workers to
synchronous_commit = off.

Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
This commit is contained in:
Peter Eisentraut
2017-04-14 13:58:46 -04:00
parent 25371a72b9
commit 887227a1cc
13 changed files with 145 additions and 33 deletions

View File

@ -1416,6 +1416,10 @@ reread_subscription(void)
MemoryContextSwitchTo(oldctx);
/* Change synchronous commit according to the user's wishes */
SetConfigOption("synchronous_commit", MySubscription->synccommit,
PGC_BACKEND, PGC_S_OVERRIDE);
if (started_tx)
CommitTransactionCommand();
@ -1485,6 +1489,10 @@ ApplyWorkerMain(Datum main_arg)
MySubscriptionValid = true;
MemoryContextSwitchTo(oldctx);
/* Setup synchronous commit according to the user's wishes */
SetConfigOption("synchronous_commit", MySubscription->synccommit,
PGC_BACKEND, PGC_S_OVERRIDE);
if (!MySubscription->enabled)
{
ereport(LOG,