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-0004eQ-RK@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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/70e7be2647106c30784627e69b9d92342e77dc3e

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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.
Next
From: Tom Lane
Date:
Subject: pgsql: Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.