Non-blocking LOCK - Mailing list pgsql-general

From Knut Aksel Røysland
Subject Non-blocking LOCK
Date
Msg-id 200006271756.29991.ganglot@ifi.uio.no
Whole thread Raw
List pgsql-general
Hi.

How can I request a lock in a non-blocking way? Instead of blocking
until a certain lock can be acquired, I would like my client
applications to give up immediately when a conflicting lock exists.

My wish is that client applications locks the data while it is being
edited, thus making the locks possibly long-lived. Subsequent update
requests to the same data, will then be rejected immediately. I am
hoping to find a server-side solution to this problem, so that rude
clients are unable to circumvent the lock.

Is the "user_locks" module (which "provides support for user-level
long-term cooperative locks") the best approach? It appears that this
solution requires well-behaving clients. Do I have other choices?


Sincerely,
Knut Aksel R�ysland

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: disk backups
Next
From: "kurt miller"
Date:
Subject: NOTICE messages during table drop