Re: Transaction-scope advisory locks

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Szymon Guz <mabewlun(at)gmail(dot)com>
Subject: Re: Transaction-scope advisory locks
Date: 2010-12-14 15:06:31
Message-ID: AANLkTi=xRvU1S_Poj2Dnz_pjs8Yr8mso5y=Caajm6+n4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 14, 2010 at 9:51 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
>> Not that I'm necessarily against the proposal, but what does this do
>> that can't already be done by locking a table or a table's row?
>
> I agree with Andres' point about this: sometimes it'd be more convenient
> for an advisory lock to be released automatically at transaction end.
> If you have a mix of clients that want that behavior with others that
> want a persistent hold on the same locks, you can't do it with regular
> locks.

right, plus 4:

automatic lock release on error. right now if I'm grabbing
in-transaction lock inside a function, I have to put in sub
transaction handler to guarantee release if anything non trivial
happens mid lock.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-12-14 15:45:28 Re: Tab completion for view triggers in psql
Previous Message Tom Lane 2010-12-14 14:59:33 Re: SQL/MED - core functionality