summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2017-06-17 12:54:21 +0000
committerPeter Eisentraut2017-06-17 12:54:21 +0000
commit033370179a6d15b2e1b519462d14419d6dc84e73 (patch)
tree3551c8656a79d9420cb268cb47ff1da285af1c24
parent7f5cb14e3c507973392e90b25cb4d36932dd42da (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.c3
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();