Help with "locking" please

From: Boris Popov <boris(at)procedium(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Help with "locking" please
Date: 2003-11-06 23:25:37
Message-ID: 48281290193.20031106152537@procedium.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig O'Shannessy 2003-11-06 23:27:40 Re: Optimiser desicion bringing system to its knees?
Previous Message Nailah Ogeer 2003-11-06 23:17:48 pg_stat

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2003-11-06 23:29:26 Re: Update cursor - current of??
Previous Message Josh Berkus 2003-11-06 20:53:04 Re: Giving a user a database