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