Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D90A1475C26 for ; Tue, 26 Nov 2002 10:30:06 -0500 (EST) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id 1C0E54766EA for ; Tue, 26 Nov 2002 10:30:03 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 18Ghf1-00065y-0U; Tue, 26 Nov 2002 15:30:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 3A60117507; Tue, 26 Nov 2002 15:24:09 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 9CED517506; Tue, 26 Nov 2002 15:24:08 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: "Rison, Stuart" , "'pgsql-sql@postgresql.org'" Subject: Re: Two TIMESTAMPs in one pl/sql function Date: Tue, 26 Nov 2002 15:24:05 +0000 User-Agent: KMail/1.4.3 References: <6BD8CE460CC6EE40B83DDFCED609F84BE140D9@cmnt4008.rvc.ac.uk> In-Reply-To: <6BD8CE460CC6EE40B83DDFCED609F84BE140D9@cmnt4008.rvc.ac.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211261524.06002.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/392 X-Sequence-Number: 10534 On Tuesday 26 Nov 2002 1:54 pm, Rison, Stuart wrote: > Hi, > > I'm trying to time a pl/sql function using a rougn and ready method, > basically: print a TIMESTAMP at the begining of the function, print a > TIMESTAMP at the end of the function. [snip] > Gives me: > > testdb2=3D# select timer(); > NOTICE: Start: 2002-11-26 13:40:14.116605+00 > NOTICE: End: 2002-11-26 13:40:14.116605+00 > I've tried all sorts of variations but I hit one of two problems; either > the TIMESTAMP is fixed to the function compile time or, as above, the > timer1 and timer2 TIMESTAMPs are always identical. Try timeofday() not now(). Quite often you want the time to stay fixed for = the=20 length of a transaction (what now() does). In this case you don't - see the= =20 Functions : date/time section of the manual for details. --=20 Richard Huxton