Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST
Date
Msg-id 20030523203228.GA26249@wolff.to
Whole thread Raw
In response to Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
On Fri, May 23, 2003 at 13:03:52 -0700, Jeff Pogodzinski <jrpogo@yahoo.com> wrote:
> Hi Bruno, 
> 
> > It is generally bad design to hold database locks while waiting for
> > user input. It is generally better to keep information about updates
> > in a table and have the applications use this information to advise
> > or prevent conncurrent updates to the same data by different people.
> 
> How would I advise of prevent conncurrent updates without locks?

You use tables in your database that are checked by the application.
Typically you would store information about what data is being worked
on and who is working on it. That way you don't block the database waiting
for input from humans. If two people want to work on the same data at the
same time, the application decides how to handle that. You may want to
prevent it (with some way to override) or just issue a warning. You may
also want to issue a warning to the second person to commit their changes
warning them that the data has been changed since they started their work.


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Bad rowtype on PL/SQL Oracle -- does anyone know?
Next
From: PeterKorman
Date:
Subject: Re: language "plpgsql" does not exist