Set statement timestamp in apply worker

This ensures that triggers can see an up-to-date timestamp.

Reported-by: Konstantin Evteev <konst583@gmail.com>
This commit is contained in:
Peter Eisentraut 2017-06-17 08:54:21 -04:00
parent 7f5cb14e3c
commit 033370179a
1 changed files with 3 additions and 0 deletions

View File

@ -157,12 +157,15 @@ ensure_transaction(void)
{
if (IsTransactionState())
{
SetCurrentStatementStartTimestamp();
if (CurrentMemoryContext != ApplyMessageContext)
MemoryContextSwitchTo(ApplyMessageContext);
return false;
}
SetCurrentStatementStartTimestamp();
StartTransactionCommand();
maybe_reread_subscription();