pgsql: Reset pg_stat_activity.xact_start during PREPARE TRANSACTION. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.
Date
Msg-id E1WdNTw-0004eW-UG@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.

Once we've completed a PREPARE, our session is not running a transaction,
so its entry in pg_stat_activity should show xact_start as null, rather
than leaving the value as the start time of the now-prepared transaction.

I think possibly this oversight was triggered by faulty extrapolation
from the adjacent comment that says PrepareTransaction should not call
AtEOXact_PgStat, so tweak the wording of that comment.

Noted by Andres Freund while considering bug #10123 from Maxim Boguk,
although this error doesn't seem to explain that report.

Back-patch to all active branches.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/82fbd88a7b0d7f31be524a9ca3f195f06940349a

Modified Files
--------------
src/backend/access/transam/xact.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: pgsql: Properly build pg_recvlogical in the msvc build system
Next
From: Tom Lane
Date:
Subject: pgsql: Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.