Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8492F632A8A for ; Mon, 12 Jul 2010 10:27:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88304-03 for ; Mon, 12 Jul 2010 13:26:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mh4.mail.rice.edu (mh4.mail.rice.edu [128.42.199.11]) by mail.postgresql.org (Postfix) with ESMTP id 82AB9632EE6 for ; Mon, 12 Jul 2010 10:26:55 -0300 (ADT) Received: from mh4.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh4.mail.rice.edu (Postfix) with ESMTP id 1FF7B37000A; Mon, 12 Jul 2010 08:26:53 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.0 at mh4.mail.rice.edu Received: from mh4.mail.rice.edu ([127.0.0.1]) by mh4.mail.rice.edu (mh4.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IGJZxIBRWtuJ; Mon, 12 Jul 2010 08:26:52 -0500 (CDT) Received: from aart.is.rice.edu (aart.is.rice.edu [168.7.56.48]) by mh4.mail.rice.edu (Postfix) with ESMTP id D10A3370018; Mon, 12 Jul 2010 08:26:52 -0500 (CDT) Received: by aart.is.rice.edu (Postfix, from userid 18612) id 842652D5A6; Mon, 12 Jul 2010 08:26:52 -0500 (CDT) Date: Mon, 12 Jul 2010 08:26:52 -0500 From: Kenneth Marshall To: Rob Wultsch Cc: "A. Kretschmer" , pgsql-performance@postgresql.org Subject: Re: now() gives same time within the session Message-ID: <20100712132652.GD11581@aart.is.rice.edu> References: <418EC9BD4D7125488CCAC5C7C559A24803A9D0@MS10.lsc.net> <20100712111500.GA14489@a-kretschmer.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/195 X-Sequence-Number: 39584 On Mon, Jul 12, 2010 at 06:11:31AM -0700, Rob Wultsch wrote: > On Mon, Jul 12, 2010 at 4:15 AM, A. Kretschmer > wrote: > > 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. > > > Is this part of the SQL standard? > No, see section 9.9.4 of the manual. Cheers, Ken