X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 47CA6923548 for ; Fri, 23 May 2003 08:41:04 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 51467-04 for ; Fri, 23 May 2003 08:40:32 -0400 (EDT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by developer.postgresql.org (Postfix) with SMTP id 71D789235A9 for ; Fri, 23 May 2003 07:16:18 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Fri May 23 13:17:07 2003 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id NAA19088; Fri, 23 May 2003 13:16:16 +0200 (METDST) Message-ID: <3ECE0300.4D57E12F@rodos.fzk.de> Date: Fri, 23 May 2003 13:16:16 +0200 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: jrpogo@yahoo.com Subject: Re: libpq program SELECT FOR UPDATE and TIMEOUT or CANCEL REQUEST Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/462 X-Sequence-Number: 13627 > > I am programming using libpq under Linux. > > When I do a "select ... for update" to lock a row, how=20 > would I allow user to cancel or timeout when requesting the > the same row from another program/transaction. > > I do not want the user to have to wait for the update on the=20 > other end. I would rather send the user an error message > saying that the record is LOCKED -- try again later. > > If you could send me an example that would be great! > There was a strongly related discussion on the pgsql-sql list in February 2003. Search the archives for threads "Lock timeout detection" "Can pessimistic locking be emulated?" If you're having trouble to find those, contact me again. I recorded the major important stuff - at least I think. Regards, Christoph