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 2C682D1E13E for ; Sun, 16 Nov 2003 23:18:34 +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 35486-03 for ; Sun, 16 Nov 2003 19:18:04 -0400 (AST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id 13F2DD1E13B for ; Sun, 16 Nov 2003 19:18:02 -0400 (AST) Received: from tokyo.samurai.com (d226-89-59.home.cgocable.net [24.226.89.59]) by bob.samurai.com (Postfix) with ESMTP id 418E51F73; Sun, 16 Nov 2003 18:18:03 -0500 (EST) To: Tom Lane Cc: Will LaShell , Hannu Krosing , Christopher Browne , pgsql-hackers@postgresql.org Subject: start of transaction (was: Re: [PERFORM] Help with count(*)) From: Neil Conway In-Reply-To: <26338.1068996163@sss.pgh.pa.us> (Tom Lane's message of "Sun, 16 Nov 2003 10:22:43 -0500") References: <200311141251.38786.mallah@trade-india.com> <1068831807.2540.44.camel@fuji.krosing.net> <3FB52FA7.8060508@lashell.net> <4987.1068842326@sss.pgh.pa.us> <87isllbcys.fsf@mailbox.samurai.com> <26338.1068996163@sss.pgh.pa.us> Date: Sun, 16 Nov 2003 18:18:02 -0500 Message-ID: <87n0avaonp.fsf@mailbox.samurai.com> User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/854 X-Sequence-Number: 47142 Tom Lane writes: > That's defensible when the user issued the BEGIN himself. When the > BEGIN is coming from some interface library's autocommit logic, it's > a lot less defensible. If you consult the archives, you will find > actual user complaints about "why is now() returning a very old time?" > that we traced to use of interface layers that handle "commit()" by > issuing "COMMIT; BEGIN;". 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. They should be using current_timestamp, and/or changing their language interface's configuration. That said, I think this is a minor irritation at best. The dual drawbacks of breaking backward compatibility and making the BEGIN semantics more confusing is enough to leave me satisfies with the status quo. If we do change this, I think Dennis' idea of making now() always return the same value within a given transaction is interesting: that might be a way to fix this problem without confusing the semantics of BEGIN. -Neil