X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B4F7E52C2C for ; Wed, 17 Aug 2005 19:07:24 -0300 (ADT) 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 04440-10 for ; Wed, 17 Aug 2005 22:07:20 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 60D7D52AE0 for ; Wed, 17 Aug 2005 19:07:16 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id C997515253; Wed, 17 Aug 2005 17:07:18 -0500 (CDT) Date: Wed, 17 Aug 2005 17:07:18 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Brendan Jurd , Bruce Momjian , pgsql-hackers@postgresql.org Subject: Re: gettime() - a timeofday() alternative Message-ID: <20050817220718.GL95876@pervasive.com> References: <37ed240d0508122330105cbf1@mail.gmail.com> <200508131435.j7DEZU013689@candle.pha.pa.us> <37ed240d05081312511423cb58@mail.gmail.com> <26263.1123971841@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26263.1123971841@sss.pgh.pa.us> X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/558 X-Sequence-Number: 71753 On Sat, Aug 13, 2005 at 06:24:01PM -0400, Tom Lane wrote: > Brendan Jurd writes: > > Regarding the statement_timestamp() ... if the entire query path is > > parser -> rewriter -> planner/optimiser -> executor, what point in > > that path would be considered the true start of the "statement"? > > IIRC, what we actually intended that to mean is the time of receipt of > the current interactive command --- that is, it gets set in the > postgres.c outer loop, not anywhere in the parser/etc path. Otherwise > there's not a unique answer (consider statements issued inside SQL > functions for instance). ISTM that it would be useful to be able to use timestamp_statement within a function though... although I guess timestamp_clock might suffice in most cases. Another consideration is that this is a potential source of confusion; people could easily think that timestamp_statement would operate the same inside a function as it would outside. Would it be reasonable to add one more timestamp that works the same inside and outside a function? In either case, can anyone think of a less-ambiguous name for timestamp_statement? -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com 512-569-9461