Skip site navigation (1) Skip section navigation (2)

Re: What's the XID?

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>, pgsql-admin(at)postgresql(dot)org
Subject: Re: What's the XID?
Date: 2007-12-27 16:27:16
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
On Thu, 27 Dec 2007, Tom Lane wrote:

> Andrew Sullivan <ajs(at)crankycanuck(dot)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;
>> 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.


So, the new XID counter won't advance unless there's at least one 
INSERT/UPDATE/DELETE in the transaction?  Does it also update for SELECTs that 
call a function which does some write activity?

Is there a new counter (or old one that I don't know about) that keeps track 
of the SELECT-only transactions?

Jeff Frost, Owner 	<jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC
Phone: 650-780-7908	FAX: 650-649-1954

In response to


pgsql-admin by date

Next:From: Andrew SullivanDate: 2007-12-27 17:31:25
Subject: Re: high-availability on MS Windows cluster -- need insights
Previous:From: Tom LaneDate: 2007-12-27 16:00:21
Subject: Re: What's the XID?

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group