Re: finding the other statement causing a sharelock - Mailing list pgsql-general

From Dimitri Fontaine
Subject Re: finding the other statement causing a sharelock
Date
Msg-id m2k4km1kx8.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: finding the other statement causing a sharelock  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.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

pgsql-general by date:

Previous
From: Andy
Date:
Subject: Re: Why facebook used mysql ?
Next
From: "Gauthier, Dave"
Date:
Subject: Re: Why facebook used mysql ?