Re: now() gives same time within the session

Поиск
Список
Период
Сортировка
От
Тема Re: now() gives same time within the session
Дата
Msg-id 418EC9BD4D7125488CCAC5C7C559A24803ACF0@MS10.lsc.net
обсуждение исходный текст
Ответ на Re: now() gives same time within the session  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-performance
Sure thanks a lot.

Regards,
Atul Goel

-----Original Message-----
From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of A. Kretschmer
Sent: 12 July 2010 12:15
To: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] now() gives same time within the session

In response to Atul.Goel@globaldatapoint.com :
> Hi,
>
>
>
> I need to log the start and end time of the procedures in a table. But the
> start and end time are same. This is how I recreated the issue.
>
>
>
> create table test_time (time timestamp);
>
> delete from  test_time;
>
> insert into test_time select now();


Use timeofday() instead, now() returns the transaction starting time.

BEGIN
test=*# select now();
              now
-------------------------------
 2010-07-12 13:13:28.907043+02
(1 row)

test=*# select timeofday();
              timeofday
--------------------------------------
 Mon Jul 12 13:13:36.187703 2010 CEST
(1 row)

test=*# select now();
              now
-------------------------------
 2010-07-12 13:13:28.907043+02
(1 row)

test=*#


Regards, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
This e-mail is confidential and should not be used by anyone who is not the original intended recipient. Global
DataPointLimited does not accept liability for any statements made which are clearly the sender's own and not expressly
madeon behalf of Global DataPoint Limited. No contracts may be concluded on behalf of Global DataPoint Limited by means
ofe-mail communication. Global DataPoint Limited Registered in England and Wales with registered number 3739752
RegisteredOffice Middlesex House, 34-42 Cleveland Street, London W1T 4LB 

В списке pgsql-performance по дате отправления:

Предыдущее
От: Jayadevan M
Дата:
Сообщение: Re: PostgreSQL PITR - more doubts
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: PostgreSQL PITR - more doubts