Re: Named advisory locks - Mailing list pgsql-general

From Ben Chobot
Subject Re: Named advisory locks
Date
Msg-id BD4B330D-ACCF-4FDC-834A-5A6618D20A3D@silentmedia.com
Whole thread Raw
In response to Re: Named advisory locks  (rihad <rihad@mail.ru>)
Responses Re: Named advisory locks
Re: Named advisory locks
List pgsql-general
On Apr 5, 2011, at 7:35 AM, rihad wrote:

> No, what I meant was that we're already using ints for a different purpose in another app on the same server, so I
cannotsafely reuse them. Aren't advisory lock ID's unique across the whole server? The sole purpose of the string ID is
tobe able to supply an initial namespace prefix ("foo.NNN") so NNN wouldn't clash in different subsystems of the app.
MySQLis pretty convenient in this regard. Now I think it would be easier for me to work around this Postgres limitation
bysimply LOCKing on some table (maybe one created specifically as something to lock on to) instead of using
pg_advisory_lockexplicitly. 

Simply locking tables might be easy, but probably won't be optimal. Why are you using advisory locks at all? They
certainlyhave their place, but they can also be an overused crutch, especially for people less familiar with MVCC. 

pgsql-general by date:

Previous
From: Ray Stell
Date:
Subject: Re: schema access privs
Next
From: rihad
Date:
Subject: Re: Named advisory locks