Re: gettime() - a timeofday() alternative

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Brendan Jurd <direvus(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: gettime() - a timeofday() alternative
Date: 2005-08-17 22:08:54
Message-ID: 200508172208.j7HM8sr17714@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Jim C. Nasby wrote:
> On Sat, Aug 13, 2005 at 06:24:01PM -0400, Tom Lane wrote:
> > Brendan Jurd <direvus(at)gmail(dot)com> writes:
> > > Regarding the statement_timestamp() ... if the entire query path is
> > > parser -> rewriter -> planner/optimiser -> executor, what point in
> > > that path would be considered the true start of the "statement"?
> >
> > IIRC, what we actually intended that to mean is the time of receipt of
> > the current interactive command --- that is, it gets set in the
> > postgres.c outer loop, not anywhere in the parser/etc path. Otherwise
> > there's not a unique answer (consider statements issued inside SQL
> > functions for instance).
>
> ISTM that it would be useful to be able to use timestamp_statement
> within a function though... although I guess timestamp_clock might
> suffice in most cases. Another consideration is that this is a potential
> source of confusion; people could easily think that timestamp_statement
> would operate the same inside a function as it would outside.
>
> Would it be reasonable to add one more timestamp that works the same
> inside and outside a function? In either case, can anyone think of a
> less-ambiguous name for timestamp_statement?

timestamp_client_statement? That highlights it is when the client sends
the statement.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-17 22:17:50 Re: gettime() - a timeofday() alternative
Previous Message Jim C. Nasby 2005-08-17 22:07:18 Re: gettime() - a timeofday() alternative

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-08-17 22:17:50 Re: gettime() - a timeofday() alternative
Previous Message Jim C. Nasby 2005-08-17 22:07:18 Re: gettime() - a timeofday() alternative