Re: finding the other statement causing a sharelock

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: finding the other statement causing a sharelock
Date: 2010-11-09 17:11:47
Message-ID: m2k4km1kx8.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> writes:
> I've some strong suspect... and I'd like to exit earlier from a
> function if a process is running but I'm not really sure how to add a
> semaphore...

Maybe pg_try_advisory_lock() would help you there?

http://www.postgresql.org/docs/8.3/static/explicit-locking.html#ADVISORY-LOCKS
http://www.postgresql.org/docs/8.3/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2010-11-09 17:16:25 Re: Why facebook used mysql ?
Previous Message Andy 2010-11-09 17:01:46 Re: Why facebook used mysql ?