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 412ED53FDC for ; Thu, 14 Apr 2005 20:20:22 -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 69192-01 for ; Thu, 14 Apr 2005 23:20:11 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4CCC053FD5 for ; Thu, 14 Apr 2005 20:20:10 -0300 (ADT) 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 j3ENKAVU027434; Thu, 14 Apr 2005 19:20:10 -0400 (EDT) To: Andreas Joseph Krogh Cc: Andrew Sullivan , pgsql-sql@postgresql.org Subject: Re: row-attribute in EXPLAIN-output doesn't match count(*) In-reply-to: <200504142157.03313.andreak@officenet.no> References: <200504141838.14705.andreak@officenet.no> <20050414190447.GE28198@dcc.uchile.cl> <20050414190818.GD9027@phlogiston.dyndns.org> <200504142157.03313.andreak@officenet.no> Comments: In-reply-to Andreas Joseph Krogh message dated "Thu, 14 Apr 2005 21:57:03 +0200" Date: Thu, 14 Apr 2005 19:20:10 -0400 Message-ID: <27433.1113520810@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/214 X-Sequence-Number: 21107 Andreas Joseph Krogh writes: > On Thursday 14 April 2005 21:08, Andrew Sullivan wrote: >> On Thu, Apr 14, 2005 at 03:04:47PM -0400, Alvaro Herrera wrote: >>> It is a Postgres limitation as well. We _could_ make the server "really >>> start the transaction" at the point the first query is issued instead of >>> when the BEGIN is issued. In fact this problem would go away if we did >>> that. > I don't see this behaviour under 8.0.0, and it's presumably fixed: > http://archives.postgresql.org/pgsql-jdbc/2004-06/msg00018.php Well, recent JDBC drivers avoid the problem by postponing BEGIN, but the issue still exists for some other client software. It's something that we probably should fix on the server side. IIRC the thing that was unresolved when we last discussed this was what time now() should reflect --- when you issue BEGIN, or when things really start to happen? To make the change fully transparent we'd have to define now() as "when you issued BEGIN", but there's a pretty good argument that now() should correspond to the time of the transaction snapshot. regards, tom lane