Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B5BF42E331B for ; Thu, 27 Dec 2007 12:12:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67933-04 for ; Thu, 27 Dec 2007 12:12:19 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4C4A52E3728 for ; Thu, 27 Dec 2007 12:00:23 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lBRG0Lk6011804; Thu, 27 Dec 2007 11:00:21 -0500 (EST) To: Andrew Sullivan cc: pgsql-admin@postgresql.org Subject: Re: What's the XID? In-reply-to: <20071227154243.GF8160@crankycanuck.ca> References: <14508639.post@talk.nabble.com> <20071227154243.GF8160@crankycanuck.ca> Comments: In-reply-to Andrew Sullivan message dated "Thu, 27 Dec 2007 10:42:43 -0500" Date: Thu, 27 Dec 2007 11:00:21 -0500 Message-ID: <11803.1198771221@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/213 X-Sequence-Number: 27730 Andrew Sullivan writes: > On Wed, Dec 26, 2007 at 05:48:14PM -0800, ivan.hou wrote: >> if i executed "select * from mydb" twice, the XID wil be increased by 2 > Yep. Whereas if you did > BEGIN; > SELECT 1; > SELECT 1; > COMMIT; > the xid would be increased by 1. But note that as of 8.3, SELECT-only transactions won't acquire an XID and hence won't advance the counter. So if you're thinking of writing code that depends on that behavior, don't. regards, tom lane