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

From Vlad Arkhipov
Subject How to check whether the row was modified by this transaction before?
Date
Msg-id 50C05E2E.4080602@dc.baikal.ru
Whole thread Raw
Responses Re: How to check whether the row was modified by this transaction before?  (Robert Haas <robertmhaas@gmail.com>)
Re: How to check whether the row was modified by this transaction before?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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).

CREATE FUNCTION test_trigger()
RETURNS TRIGGER AS $$
BEGIN  IF OLD.xmin = txid_current() THEN    -- Do something.  ELSE    -- Do something else.  END IF;
END;
$$ LANGUAGE plpgsql;



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: why can't plpgsql return a row-expression?
Next
From: Pavan Deolasee
Date:
Subject: Setting visibility map in VACUUM's second phase