diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-08-04 21:14:35 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-08-04 21:17:47 -0400 |
commit | 7e174fa793a2df89fe03d002a5087ef67abcdde8 (patch) | |
tree | 5fa4c053b549ffd960858c4eefa84c123f2d0157 /src/backend/access/transam/xact.c | |
parent | ff98a5e1e49de061600feb6b4de5ce0a22d386af (diff) | |
download | postgresql-7e174fa793a2df89fe03d002a5087ef67abcdde8.tar.gz postgresql-7e174fa793a2df89fe03d002a5087ef67abcdde8.zip |
Only kill sync workers at commit time in subscription DDL
This allows a transaction abort to avoid killing those workers.
Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r-- | src/backend/access/transam/xact.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index b0aa69fe4b4..50c3c3b5e5e 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -2277,6 +2277,15 @@ PrepareTransaction(void) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot PREPARE a transaction that has exported snapshots"))); + /* + * Don't allow PREPARE but for transaction that has/might kill logical + * replication workers. + */ + if (XactManipulatesLogicalReplicationWorkers()) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot PREPARE a transaction that has manipulated logical replication workers"))); + /* Prevent cancel/die interrupt while cleaning up */ HOLD_INTERRUPTS(); |