Skip site navigation (1) Skip section navigation (2)

Re: now() gives same time within the session

From: Kenneth Marshall <ktm(at)rice(dot)edu>
To: Rob Wultsch <wultsch(at)gmail(dot)com>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>,pgsql-performance(at)postgresql(dot)org
Subject: Re: now() gives same time within the session
Date: 2010-07-12 13:26:52
Message-ID: 20100712132652.GD11581@aart.is.rice.edu (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, Jul 12, 2010 at 06:11:31AM -0700, Rob Wultsch wrote:
> On Mon, Jul 12, 2010 at 4:15 AM, A. Kretschmer
> <andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> > In response to Atul(dot)Goel(at)globaldatapoint(dot)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.
> 
> 
> Is this part of the SQL standard?
> 
No, see section 9.9.4 of the manual.

Cheers,
Ken

In response to

pgsql-performance by date

Next:From: Віталій ТимчишинDate: 2010-07-12 13:29:07
Subject: Exists, limit and alternate plans
Previous:From: A. KretschmerDate: 2010-07-12 13:24:56
Subject: Re: now() gives same time within the session

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group