Re: What's the XID?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: What's the XID?
Date: 2007-12-27 16:00:21
Message-ID: 11803.1198771221@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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;
> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Frost 2007-12-27 16:27:16 Re: What's the XID?
Previous Message George, Harry G 2007-12-27 15:45:36 high-availability on MS Windows cluster -- need insights