Help with "locking" please - Mailing list pgsql-general

From Boris Popov
Subject Help with "locking" please
Date
Msg-id 48281290193.20031106152537@procedium.com
Whole thread Raw
Responses Re: [NOVICE] Help with "locking" please
List pgsql-general
Hello,

Here's a scenario I am trying to find a solution for. I have a
contacts table individual rows of which can be edited in our app. I'd
like to be able to mark a row as 'opened by someone else' when editor
is opened and un-mark it when window is closed. No problems there, I
could add a procpid(int4) column and update it with current process'
PID on window open and with null on window close. One case however is
an unexpected error where client app doesn't reset the procpid to
null and that's a problem I'm trying to solve.

My first instict would be to make procpid reference
pg_stat_activity(procpid), but of course that's a view, so its not
going to fly.

What's a common pattern that deals with these kinds of issues? I'd
like to be able to do this in other areas of the application also.

Any help will be appreciated!

--
-Boris



pgsql-general by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: create function for trigger question
Next
From: "Craig O'Shannessy"
Date:
Subject: Re: Optimiser desicion bringing system to its knees?