Re: How to check whether the row was modified by this transaction before?
От | Andres Freund |
---|---|
Тема | Re: How to check whether the row was modified by this transaction before? |
Дата | |
Msg-id | 20121206190850.GE20926@awork2.anarazel.de обсуждение исходный текст |
Ответ на | Re: How to check whether the row was modified by this transaction before? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Re: How to check whether the row was modified by this transaction before?
|
Список | pgsql-hackers |
On 2012-12-06 13:59:32 -0500, Tom Lane wrote: > 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. I think architectures with an invalidation-queue to external caches (be it web-proxies or something lower-level) are quite popular. And with the new NOTIFY or pgq relatively simple. Ad to those its sensible not to post a single primary key more than once. Magnus had talks about specifically that on various conferences if that counts as anything ;) Mainstreamy enough? Andres --Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: