From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Brendan Jurd <direvus@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: gettime() - a timeofday() alternative
Date: Fri, 12 Aug 2005 22:34:08 -0400 (EDT)
Message-ID: <200508130234.j7D2Y8G01356@candle.pha.pa.us> (raw)
In-Reply-To: <37ed240d05080623101d1094a1@mail.gmail.com>
Brendan Jurd wrote:
> Hi all,
>
> I propose to add an internal function gettime() that transparently
> returns the current system time, as a timestamptz with maximum
> precision.
>
> Calling gettime() would be a more elegant approach than calling
> timeofday() and converting it to a timestamp, and avoids some of the
> potential problems in that conversion (such as "Sat" being
> misinterpreted as an Australian timezone).
>
> I'm open to alternate suggestions for the name of the function.
>
> If there are no objections, I'll start cooking up a patch right away.
We already have a TODO for this:
* Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
functionality
Current CURRENT_TIMESTAMP returns the start time of the current
transaction, and gettimeofday() returns the wallclock time. This will
make time reporting more consistent and will allow reporting of
the statement start time.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: pgman@candle.pha.pa.us, direvus@gmail.com
Subject: Re: gettime() - a timeofday() alternative
In-Reply-To: <200508130234.j7D2Y8G01356@candle.pha.pa.us>
References: <37ed240d05080623101d1094a1@mail.gmail.com> <200508130234.j7D2Y8G01356@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox