git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f5cb14)
Set statement timestamp in apply worker
2017年6月17日 12:54:21 +0000 (08:54 -0400)
2017年6月17日 12:54:21 +0000 (08:54 -0400)
This ensures that triggers can see an up-to-date timestamp.

Reported-by: Konstantin Evteev <konst583@gmail.com>

diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 97d2dff0dd34b5c2ce44003e4eaeb6cb2b92a99c..21a4fea821dcd07bea913614b7f4b0f0791a3dc2 100644 (file)
--- 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();
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /