aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/timestamp.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-06-29 22:51:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-06-29 22:51:57 +0000
commitb5f7cff84f57a189ed5c9dd59efe8d2568649d0d (patch)
tree77b5a25a7c4a62145ba89a578018121b3246b82d /src/include/utils/timestamp.h
parentc33d575899593a46a5b9a76e4e0ef6f9d81e55dd (diff)
downloadpostgresql-b5f7cff84f57a189ed5c9dd59efe8d2568649d0d.tar.gz
postgresql-b5f7cff84f57a189ed5c9dd59efe8d2568649d0d.zip
Clean up the rather historically encumbered interface to now() and
current time: provide a GetCurrentTimestamp() function that returns current time in the form of a TimestampTz, instead of separate time_t and microseconds fields. This is what all the callers really want anyway, and it eliminates low-level dependencies on AbsoluteTime, which is a deprecated datatype that will have to disappear eventually.
Diffstat (limited to 'src/include/utils/timestamp.h')
-rw-r--r--src/include/utils/timestamp.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index 7475dacbe7c..1cd591326c7 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.45 2005/06/15 00:34:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.46 2005/06/29 22:51:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -156,6 +156,10 @@ typedef double fsec_t;
#define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK)
+/* Set at postmaster start */
+extern TimestampTz PgStartTime;
+
+
/*
* timestamp.c prototypes
*/
@@ -258,10 +262,10 @@ extern Datum now(PG_FUNCTION_ARGS);
extern Datum pgsql_postmaster_start_time(PG_FUNCTION_ARGS);
-extern TimestampTz StartTime;
-
/* Internal routines (not fmgr-callable) */
+extern TimestampTz GetCurrentTimestamp(void);
+
extern int tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *dt);
extern int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm,
fsec_t *fsec, char **tzn, pg_tz *attimezone);