diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-30 21:01:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-30 21:01:53 +0000 |
commit | c4320619635800a6116a02eee08b232c5abea266 (patch) | |
tree | 3db9b7562baf005c9ccf4976c293a4328dfa9509 /src/backend/access/transam/twophase.c | |
parent | 641912b4d17fd214a5e5bae4e7bb9ddbc28b144b (diff) | |
download | postgresql-c4320619635800a6116a02eee08b232c5abea266.tar.gz postgresql-c4320619635800a6116a02eee08b232c5abea266.zip |
Change the timestamps recorded in transaction commit/abort xlog records
from time_t to TimestampTz representation. This provides full gettimeofday()
resolution of the timestamps, which might be useful when attempting to
do point-in-time recovery --- previously it was not possible to specify
the stop point with sub-second resolution. But mostly this is to get
rid of TimestampTz-to-time_t conversion overhead during commit. Per my
proposal of a day or two back.
Diffstat (limited to 'src/backend/access/transam/twophase.c')
-rw-r--r-- | src/backend/access/transam/twophase.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 7d6680485b0..6f495a84087 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.29 2007/04/03 16:34:35 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.30 2007/04/30 21:01:52 tgl Exp $ * * NOTES * Each global transaction is associated with a global transaction @@ -1675,7 +1675,7 @@ RecordTransactionCommitPrepared(TransactionId xid, /* Emit the XLOG commit record */ xlrec.xid = xid; - xlrec.crec.xtime = time(NULL); + xlrec.crec.xact_time = GetCurrentTimestamp(); xlrec.crec.nrels = nrels; xlrec.crec.nsubxacts = nchildren; rdata[0].data = (char *) (&xlrec); @@ -1753,7 +1753,7 @@ RecordTransactionAbortPrepared(TransactionId xid, /* Emit the XLOG abort record */ xlrec.xid = xid; - xlrec.arec.xtime = time(NULL); + xlrec.arec.xact_time = GetCurrentTimestamp(); xlrec.arec.nrels = nrels; xlrec.arec.nsubxacts = nchildren; rdata[0].data = (char *) (&xlrec); |