Re: Why does txid_current() assign new transaction-id? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why does txid_current() assign new transaction-id?
Date
Msg-id 14207.1432650862@sss.pgh.pa.us
Whole thread Raw
In response to Why does txid_current() assign new transaction-id?  (Naoya Anzai <nao-anzai@xc.jp.nec.com>)
Responses Re: Why does txid_current() assign new transaction-id?  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
Naoya Anzai <nao-anzai@xc.jp.nec.com> writes:
> I have a question about txid_current().
> it is "Why does txid_current() assign new transaction-id?".

Consider
begin;select txid_current();insert into my_table ...;commit;

If we changed the code as you propose, the result of the SELECT would
no longer have anything to do with the XID used for the insertion.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: brin regression test intermittent failures
Next
From: Tom Lane
Date:
Subject: Re: fsync-pgdata-on-recovery tries to write to more files than previously