Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EC4751337B39 for ; Wed, 19 Jan 2011 14:41:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 23371-08 for ; Wed, 19 Jan 2011 18:41:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6DE4C13364DE for ; Wed, 19 Jan 2011 14:41:10 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 19 Jan 2011 12:41:09 -0600 Message-Id: <4D36DBE202000025000397F8@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 19 Jan 2011 12:41:06 -0600 From: "Kevin Grittner" To: "Chris Browne" Cc: "Andres Freund" , Subject: Re: the XID question References: <4D36A35302000025000397CC@gw.wicourts.gov> <878vyg9399.fsf@cbbrowne.afilias-int.info> <201101191931.52841.andres@anarazel.de> In-Reply-To: <201101191931.52841.andres@anarazel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/173 X-Sequence-Number: 41960 Andres Freund wrote: > On Wednesday, January 19, 2011 07:06:58 PM Chris Browne wrote: >> A read-only transaction won't consume XIDs, but if you don't >> expressly declare it read-only, they're still liable to get >> eaten... > No. The Xid is generally only allocated at the first place a real > xid is needed. See GetCurrentTransactionId, AssignTransactionId in > xact.c and the caller of the former. Or just test it in psql. BEGIN, run your query, look at pg_locks. If an xid has been assigned, you'll see it there in the transactionid column. You can easily satisfy yourself which statements grab an xid.... -Kevin