1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-06 00:02:13 +03:00

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.
This commit is contained in:
Tom Lane
2005-06-29 22:51:57 +00:00
parent c33d575899
commit b5f7cff84f
19 changed files with 135 additions and 213 deletions

View File

@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.97 2005/06/28 05:08:59 tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.98 2005/06/29 22:51:55 tgl Exp $
* ----------
*/
#include "postgres.h"
@@ -2026,10 +2026,8 @@ pgstat_add_backend(PgStat_MsgHdr *msg)
/* Put this new backend into the slot */
beentry->procpid = msg->m_procpid;
beentry->start_sec =
GetCurrentAbsoluteTimeUsec(&beentry->start_usec);
beentry->activity_start_sec = 0;
beentry->activity_start_usec = 0;
beentry->start_timestamp = GetCurrentTimestamp();
beentry->activity_start_timestamp = 0;
beentry->activity[0] = '\0';
/*
@@ -2665,8 +2663,7 @@ pgstat_recv_activity(PgStat_MsgActivity *msg, int len)
StrNCpy(entry->activity, msg->m_what, PGSTAT_ACTIVITY_SIZE);
entry->activity_start_sec =
GetCurrentAbsoluteTimeUsec(&entry->activity_start_usec);
entry->activity_start_timestamp = GetCurrentTimestamp();
}