Re: check if table/object is locked - Mailing list pgsql-sql

From Rod Taylor
Subject Re: check if table/object is locked
Date
Msg-id 1047224138.28251.210.camel@jester
Whole thread Raw
In response to check if table/object is locked  (Jonathan Weiss <infojowe@gmx.de>)
List pgsql-sql
Simple answer is don't lock it like that.

Store a 'last changed' date that you update when you change the tuple.
Confirm prior to writing that the 'last change' date hasn't changed
since you pulled out the information to display to the user (yes, do the
for update lock during this much shorter time).

On Sun, 2003-03-09 at 10:14, Jonathan Weiss wrote:
> hi!
>
>
> i have a problem. i developed an application for administrating cliet and
> their sales. if i want to edit a client i load him by select for update. now if
> another person want to update him, the query waits, until the first
> connection is closed. this is unacceptable, because the whole application is doing
> nothing until the db is responding. how can i check if the client is locked
> before i want to load him?
>
> thanks,
>
>
> Jonathan Weiss
--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

pgsql-sql by date:

Previous
From: Jonathan Weiss
Date:
Subject: check if table/object is locked
Next
From: Vernon Wu
Date:
Subject: Special characters in SQL queries