Re: Transaction-scope advisory locks

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Szymon Guz <mabewlun(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transaction-scope advisory locks
Date: 2010-12-14 00:51:05
Message-ID: 4D06BF79.5080605@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2010-12-14 2:35 AM +0200, Simon Riggs wrote:
> On Tue, 2010-12-14 at 01:14 +0200, Marko Tiikkaja wrote:
>> Oh, I forgot to mention. The patch doesn't change any existing
>> behaviour; the new behaviour can be invoked only by adding a new boolean
>> argument:
>>
>> SELECT pg_advisory_lock(1, false);
>
> Don't like adding a boolean. Nobody remembers what it is for and we have
> bugs. How about pg_advisory_xact_lock()

That's the other option I was thinking of, but didn't like that too
much. But you're right about the boolean, it is a bit hard to remember
which behaviour is which.

>> The lock space is the same though, but I don't feel strongly about it.
>
> Same lock space is good. Easy to separate if required.
>
> Explicitly nameable lock spaces would be even better, since if multiple
> applications use them you get strange and unmanageable contention.

I think something like this has been suggested in the past, and was
rejected at that time.

Regards,
Marko Tiikkaja

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-12-14 00:58:39 Re: rest of works for security providers in v9.1
Previous Message Andrew Dunstan 2010-12-14 00:50:21 Re: Transaction-scope advisory locks