X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C318132A0AC for ; Tue, 5 Oct 2004 17:07:08 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58413-09 for ; Tue, 5 Oct 2004 16:06:59 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7A4B8329FC5 for ; Tue, 5 Oct 2004 17:06:58 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i95G6txK015687; Tue, 5 Oct 2004 12:06:55 -0400 (EDT) To: Silke Trissl Cc: pgsql-sql@postgresql.org Subject: Re: Using timestamp in function In-reply-to: <4162BFCF.9090501@informatik.hu-berlin.de> References: <4162BFCF.9090501@informatik.hu-berlin.de> Comments: In-reply-to Silke Trissl message dated "Tue, 05 Oct 2004 17:37:51 +0200" Date: Tue, 05 Oct 2004 12:06:55 -0400 Message-ID: <15686.1096992415@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/30 X-Sequence-Number: 19133 Silke Trissl writes: > I expected, that the variable curtime gets a new time value, each time > the function is called (at least that is what I understood from the > documentation). This works fine, if I test it with > SELECT mylog_test(5, 'test'); > But as soon as I call the funtion from another function (which I need) > the variable curtime does not change anymore. "now" refers to the transaction start time. You can get at current time of day with the timeofday() function. regards, tom lane