How to check whether the row was modified by this transaction before?

Поиск
Список
Период
Сортировка
От Vlad Arkhipov
Тема How to check whether the row was modified by this transaction before?
Дата
Msg-id 50C05E2E.4080602@dc.baikal.ru
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: why can't plpgsql return a row-expression?
Следующее
От: Pavan Deolasee
Дата:
Сообщение: Setting visibility map in VACUUM's second phase