Re: How to check whether the row was modified by this transaction before? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to check whether the row was modified by this transaction before?
Date
Msg-id 7386.1354820372@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to check whether the row was modified by this transaction before?  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: How to check whether the row was modified by this transaction before?
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2012-12-06 15:08:51 -0300, Alvaro Herrera wrote:
>> Vlad Arkhipov <arhipov@dc.baikal.ru> writes:
>>> In a BEFORE UPDATE trigger I need to know whether the row was previously
>>> modified by this transaction. Is it safe to use xmin and txid_current()
>>> for this purpose (xmin is 32-bit txid type but txid_current() returns
>>> 64-bit bigint).

> I wonder if we shouldn't have a function txid_is_current(xid);

Yeah, I was wondering that too, and wanted to know if the OP had a
use-case that was mainstream enough to justify adding such a function.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Setting visibility map in VACUUM's second phase
Next
From: Andres Freund
Date:
Subject: Re: ALTER TABLE ... NOREWRITE option