X-Original-To: pgsql-general@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C2999476073 for ; Fri, 28 Feb 2003 11:32:17 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 63841-10 for ; Fri, 28 Feb 2003 11:32:07 -0500 (EST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by postgresql.org (Postfix) with ESMTP id B366D47610D for ; Fri, 28 Feb 2003 10:09:26 -0500 (EST) Received: from DU150.N224.ResNet.QueensU.CA (DU150.N224.ResNet.QueensU.CA [130.15.224.150]) by bob.samurai.com (Postfix) with ESMTP id E851F1D60; Fri, 28 Feb 2003 10:09:26 -0500 (EST) Subject: Re: Locking rows From: Neil Conway To: Jean-Christian Imbeault Cc: PostgreSQL General In-Reply-To: <3E5F396F.4090507@mega-bucks.co.jp> References: <3E5F396F.4090507@mega-bucks.co.jp> Content-Type: text/plain Organization: Message-Id: <1046444926.430.90.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 28 Feb 2003 10:08:46 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/1699 X-Sequence-Number: 38453 On Fri, 2003-02-28 at 05:26, Jean-Christian Imbeault wrote: > I have written an application that prints out data from a database. One > problem I am encountering is in the time it takes to generate the print > file the data may have changed. Is that a problem? ISTM that if you need to keep the DB consistent during the entire print job, you're going to get pretty poor concurrent performance regardless. > I've read the iDocs and Bruce's online manual but can seem to find any > info on the syntax for locking other that for SELECT FOR UPDATE. And > even then the docs don't state how to remove the lock created by a > SELECT FOR UPDATE. The docs on FOR UPDATE say: This prevents them from being modified or deleted by other transactions until the current transaction ends; that is, other transactions that attempt UPDATE, DELETE, or SELECT FOR UPDATE of these rows will be blocked until the current transaction ends. Cheers, Neil -- Neil Conway || PGP Key ID: DB3C29FC