pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-admin@postgresql.org
Subject: Re: What's the XID?
Date: Thu, 27 Dec 2007 11:00:21 -0500
Message-ID: <11803.1198771221@sss.pgh.pa.us> (raw)
In-Reply-To: <20071227154243.GF8160@crankycanuck.ca>
References: <14508639.post@talk.nabble.com>
	<20071227154243.GF8160@crankycanuck.ca>

Andrew Sullivan <ajs@crankycanuck.ca> 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



view thread (18+ messages)  latest in thread

Message-ID: <11803.1198771221@sss.pgh.pa.us>
Permalink:  ../11803.1198771221@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11803.1198771221@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ajs@crankycanuck.ca
  Subject: Re: What's the XID?
  In-Reply-To: <11803.1198771221@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox