Re: current_timestamp after queries

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Guido Staub <staub(at)gik(dot)uni-karlsruhe(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: current_timestamp after queries
Date: 2002-09-30 15:02:55
Message-ID: 200209301502.g8UF2tB14383@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Yes, timeofday() will work, but it can change during the statement, right?

---------------------------------------------------------------------------

Martijn van Oosterhout wrote:
> On Mon, Sep 30, 2002 at 11:44:17AM +0200, Guido Staub wrote:
>
> [some current_timestamp stuff]
>
> > I think that the accuracy is not good enough because I've started two
> > BEGIN statements and some time is elapsing between them. Am I right?
> > Or does anybody know a better solution to store the elapsed time after
> > some queries without writing some code in C or JAVA?
>
> Perhaps you're looking for timeofday()?
>
> kleptog=# begin; select timeofday(); select timeofday(); commit;
> BEGIN
> timeofday
> -------------------------------------
> Mon Sep 30 19:54:41.559605 2002 EST
> (1 row)
>
> timeofday
> -------------------------------------
> Mon Sep 30 19:54:41.560018 2002 EST
> (1 row)
>
> COMMIT
>
> Hope this helps,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > There are 10 kinds of people in the world, those that can do binary
> > arithmetic and those that can't.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
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-general by date

  From Date Subject
Next Message Tom Lane 2002-09-30 15:07:47 Re: LIMIT: does it cause the query to find all matching sets first?
Previous Message Bruce Momjian 2002-09-30 15:02:17 Re: current_timestamp after queries

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-09-30 15:09:01 Re: Cause of missing pg_clog files
Previous Message Bruce Momjian 2002-09-30 15:02:17 Re: current_timestamp after queries