aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r--src/backend/access/transam/xact.c35
-rw-r--r--src/backend/access/transam/xlog.c3
2 files changed, 11 insertions, 27 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index a5d53d3e145..1df9cfa7ba0 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.208 2005/06/28 05:08:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.209 2005/06/29 22:51:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -168,12 +168,11 @@ static SubTransactionId currentSubTransactionId;
static CommandId currentCommandId;
/*
- * These vars hold the value of now(), ie, the transaction start time.
+ * This is the value of now(), ie, the transaction start time.
* This does not change as we enter and exit subtransactions, so we don't
* keep it inside the TransactionState stack.
*/
-static AbsoluteTime xactStartTime; /* integer part */
-static int xactStartTimeUsec; /* microsecond part */
+static TimestampTz xactStartTimestamp;
/*
* GID to be used for preparing the current transaction. This is also
@@ -420,28 +419,15 @@ GetCurrentCommandId(void)
return currentCommandId;
}
-
-/*
- * GetCurrentTransactionStartTime
- */
-AbsoluteTime
-GetCurrentTransactionStartTime(void)
-{
- return xactStartTime;
-}
-
-
/*
- * GetCurrentTransactionStartTimeUsec
+ * GetCurrentTransactionStartTimestamp
*/
-AbsoluteTime
-GetCurrentTransactionStartTimeUsec(int *msec)
+TimestampTz
+GetCurrentTransactionStartTimestamp(void)
{
- *msec = xactStartTimeUsec;
- return xactStartTime;
+ return xactStartTimestamp;
}
-
/*
* GetCurrentTransactionNestLevel
*
@@ -1391,7 +1377,7 @@ StartTransaction(void)
/*
* set now()
*/
- xactStartTime = GetCurrentAbsoluteTimeUsec(&(xactStartTimeUsec));
+ xactStartTimestamp = GetCurrentTimestamp();
/*
* initialize current transaction state fields
@@ -1633,8 +1619,6 @@ PrepareTransaction(void)
TransactionId xid = GetCurrentTransactionId();
GlobalTransaction gxact;
TimestampTz prepared_at;
- AbsoluteTime PreparedSec; /* integer part */
- int PreparedUSec; /* microsecond part */
ShowTransactionState("PrepareTransaction");
@@ -1697,8 +1681,7 @@ PrepareTransaction(void)
*/
s->state = TRANS_PREPARE;
- PreparedSec = GetCurrentAbsoluteTimeUsec(&PreparedUSec);
- prepared_at = AbsoluteTimeUsecToTimestampTz(PreparedSec, PreparedUSec);
+ prepared_at = GetCurrentTimestamp();
/* Tell bufmgr and smgr to prepare for commit */
BufmgrCommit();
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 3a55a521c17..93f8d75e6cc 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.203 2005/06/19 21:34:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.204 2005/06/29 22:51:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -43,6 +43,7 @@
#include "storage/spin.h"
#include "utils/builtins.h"
#include "utils/guc.h"
+#include "utils/nabstime.h"
#include "utils/relcache.h"