diff options
author | Peter Eisentraut | 2017-06-17 12:54:21 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-06-17 12:54:21 +0000 |
commit | 033370179a6d15b2e1b519462d14419d6dc84e73 (patch) | |
tree | 3551c8656a79d9420cb268cb47ff1da285af1c24 | |
parent | 7f5cb14e3c507973392e90b25cb4d36932dd42da (diff) |
Set statement timestamp in apply worker
This ensures that triggers can see an up-to-date timestamp.
Reported-by: Konstantin Evteev <[email protected]>
-rw-r--r-- | src/backend/replication/logical/worker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 97d2dff0dd..21a4fea821 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -157,12 +157,15 @@ ensure_transaction(void) { if (IsTransactionState()) { + SetCurrentStatementStartTimestamp(); + if (CurrentMemoryContext != ApplyMessageContext) MemoryContextSwitchTo(ApplyMessageContext); return false; } + SetCurrentStatementStartTimestamp(); StartTransactionCommand(); maybe_reread_subscription(); |