Re: txid_current() forces a real xid

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: txid_current() forces a real xid
Date: 2011-07-11 15:18:06
Message-ID: 12786.1310397486@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Right now, calling txid_current() causes a session to create a
> non-virtual xid if not already assigned, so observing the xid creates
> it, which seems kind of odd. Is that intended?

GetTopTransactionId (and friends) should only be called in places where
the intent is to assign an xid if we haven't already got one. I'm not
sure what the use case is for txid_current(), but it's at least
plausible that applications using it would have the same intention.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2011-07-11 15:21:39 Re: Need help understanding pg_locks
Previous Message Tom Lane 2011-07-11 15:13:50 Re: Full GUID support