]> granicus.if.org Git - postgresql/commit
Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Apr 2014 17:29:48 +0000 (13:29 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 Apr 2014 17:30:14 +0000 (13:30 -0400)
commit82fbd88a7b0d7f31be524a9ca3f195f06940349a
treec86be8ef53ca8dfbed55e99a91b43d5edcf9cb3f
parent2d06f6132908c174cd95e55ee649734e269a766c
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.
src/backend/access/transam/xact.c