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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: why can't plpgsql return a row-expression?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Commits 8de72b and 5457a1 (COPY FREEZE)