X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AF863D1E139 for ; Mon, 17 Nov 2003 00:32:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 52446-01 for ; Sun, 16 Nov 2003 20:31:31 -0400 (AST) Received: from candle.pha.pa.us (unknown [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 9B3E6D1B555 for ; Sun, 16 Nov 2003 20:31:27 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id hAH0VD328503; Sun, 16 Nov 2003 19:31:13 -0500 (EST) From: Bruce Momjian Message-Id: <200311170031.hAH0VD328503@candle.pha.pa.us> Subject: Re: start of transaction (was: Re: [PERFORM] Help with count(*)) In-Reply-To: <3798.1069027704@sss.pgh.pa.us> To: Tom Lane Date: Sun, 16 Nov 2003 19:31:13 -0500 (EST) Cc: Neil Conway , Will LaShell , Hannu Krosing , Christopher Browne , pgsql-hackers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/856 X-Sequence-Number: 47144 Tom Lane wrote: > Neil Conway writes: > > Hmmm... I agree this behavior isn't ideal, although I can see the case > > for viewing this as a mistake by the application developer: they are > > assuming that they know exactly when transactions begin, which is not > > a feature provided by their language interface. > > Well, actually, it's a bug in the interface IMHO. But as I said in the > last thread, it's a fairly widespread bug. We've been taking the > position that the interface libraries should get fixed, and that's not > happening. It's probably time to look at a server-side fix. > > > If we do change this, I think Dennis' idea of making now() always > > return the same value within a given transaction is interesting: > > You mean the time of the first now() call? I thought that was an > interesting idea also, but it's probably not going to look so hot > when we complete the TODO item of adding access to > the start-of-current-statement time. Having start-of-transaction be > later than start-of-statement isn't gonna fly :-(. If we were willing > to abandon that TODO item then I'd be interested in defining now() as > Dennis suggested. Defining now() as the first call seems pretty arbitrary to me. I can't think of any time-based interface that has that API. And what if a trigger called now() in an earlier query and you didn't even know about it. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073