diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-09-28 08:09:14 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-09-28 08:09:14 +0000 |
commit | 6f58115dddfa8ca63004c4784f57ef660422861d (patch) | |
tree | 71816e03286e53113ec4b6de337f0b345028a314 /src/backend/access/transam/xact.c | |
parent | 1f075a32ee28004251f508f50a4325944801da10 (diff) | |
download | postgresql-6f58115dddfa8ca63004c4784f57ef660422861d.tar.gz postgresql-6f58115dddfa8ca63004c4784f57ef660422861d.zip |
Measure the current transaction time to milliseconds.
Define a new function, GetCurrentTransactionStartTimeUsec() to get the time
to this precision.
Allow now() and timestamp 'now' to use this higher precision result so
we now have fractional seconds in this "constant".
Add timestamp without time zone type.
Move previous timestamp type to timestamp with time zone.
Accept another ISO variant for date/time values: yyyy-mm-ddThh:mm:ss
(note the "T" separating the day from hours information).
Remove 'current' from date/time types; convert to 'now' in input.
Separate time and timetz regression tests.
Separate timestamp and timestamptz regression test.
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r-- | src/backend/access/transam/xact.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index c3d6326d42a..6b0d4de720e 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.109 2001/08/25 18:52:41 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.110 2001/09/28 08:08:57 thomas Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -370,6 +370,21 @@ GetCurrentTransactionStartTime(void) /* -------------------------------- + * GetCurrentTransactionStartTimeUsec + * -------------------------------- + */ +AbsoluteTime +GetCurrentTransactionStartTimeUsec(int *msec) +{ + TransactionState s = CurrentTransactionState; + + *msec = s->startTimeMsec; + + return s->startTime; +} + + +/* -------------------------------- * TransactionIdIsCurrentTransactionId * -------------------------------- */ @@ -859,7 +874,10 @@ StartTransaction(void) */ s->commandId = FirstCommandId; s->scanCommandId = FirstCommandId; +#if NOT_USED s->startTime = GetCurrentAbsoluteTime(); +#endif + s->startTime = GetCurrentAbsoluteTimeUsec(&(s->startTimeMsec)); /* * initialize the various transaction subsystems |