mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: xact.h,v 1.36 2001/08/26 16:56:00 tgl Exp $
|
||||
* $Id: xact.h,v 1.37 2001/09/28 08:09:12 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "access/transam.h"
|
||||
#include "access/xlog.h"
|
||||
#include "utils/nabstime.h"
|
||||
#include "utils/timestamp.h"
|
||||
|
||||
/*
|
||||
* Xact isolation levels
|
||||
@@ -39,6 +40,7 @@ typedef struct TransactionStateData
|
||||
CommandId commandId;
|
||||
CommandId scanCommandId;
|
||||
AbsoluteTime startTime;
|
||||
int startTimeMsec;
|
||||
int state;
|
||||
int blockState;
|
||||
} TransactionStateData;
|
||||
@@ -104,6 +106,7 @@ extern CommandId GetCurrentCommandId(void);
|
||||
extern CommandId GetScanCommandId(void);
|
||||
extern void SetScanCommandId(CommandId);
|
||||
extern AbsoluteTime GetCurrentTransactionStartTime(void);
|
||||
extern AbsoluteTime GetCurrentTransactionStartTimeUsec(int *usec);
|
||||
extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
|
||||
extern bool CommandIdIsCurrentCommandId(CommandId cid);
|
||||
extern bool CommandIdGEScanCommandId(CommandId cid);
|
||||
|
||||
Reference in New Issue
Block a user