Re: current_timestamp after queries

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Guido Staub <staub(at)gik(dot)uni-karlsruhe(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: current_timestamp after queries
Date: 2002-10-01 15:13:31
Message-ID: 200210011513.g91FDV017222@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Guido Staub wrote:
> timeofday() works better than current_timestamp, but I have to use a
> CAST-Statement to make it possible to calculate the elapsed time.
> What do you mean with change during the statement?
> The only change I see after using timeofday() is that the calculated time for
> doing the query the first time and a second time again differ a llittle bit,
> although that query1 and query2 are equal in the transaction and that I've used
> the same relation.
> Guido Staub

Here is an example of timeofday() changing during a query:

test=> CREATE TEMP TABLE xx AS select timeofday() UNION select
timeofday();
SELECT
test=> SELECT * FROM xx;
timeofday
--------------------------------------
Tue Oct 01 17:09:23.381304 2002 CEST
Tue Oct 01 17:09:23.381393 2002 CEST
(2 rows)

--
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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-10-01 15:19:39 Re: performance
Previous Message Ben-Nes Michael 2002-10-01 14:40:10 Re: Major Problem with locale

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-01 15:17:16 Re: 7.2.3 patching done
Previous Message Tom Lane 2002-10-01 14:31:45 Re: floor function in 7.3b2