X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 221D6D1D501 for ; Wed, 18 Feb 2004 02:21:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 36604-05 for ; Tue, 17 Feb 2004 22:21:35 -0400 (AST) Received: from internet.potentialtech.com (h-66-167-251-6.PHLAPAFG.covad.net [66.167.251.6]) by svr1.postgresql.org (Postfix) with ESMTP id 5585DD1B484 for ; Tue, 17 Feb 2004 22:21:31 -0400 (AST) Received: from potentialtech.com (pa-plum1c-102.pit.adelphia.net [24.53.179.102]) by internet.potentialtech.com (Postfix) with ESMTP id A539669A71; Tue, 17 Feb 2004 21:21:34 -0500 (EST) Message-ID: <4032CC2B.9030208@potentialtech.com> Date: Tue, 17 Feb 2004 21:21:31 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "scott.marlowe" Cc: Christopher Kings-Lynne , Saleem Burhani Baloch , pgsql-performance@postgresql.org Subject: Re: Slow response of PostgreSQL References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/204 X-Sequence-Number: 5728 scott.marlowe wrote: > On Wed, 18 Feb 2004, Christopher Kings-Lynne wrote: > >>>>>1- How can I lock a single record so that other users can only read >>>>>it. ?? >>>> >>>> >>>>You cannot do that in PostgreSQL. >>> >>> >>>How about SELECT ... FOR UPDATE? >> >>No, because users cannot read the locked row in that case. > > I just tested it (within transactions) and it appeared that I could still > view the rows selected for update. Thank you. I was just about to test it myself. The user's guide, section 9.3.2 states that this is the case: i.e. select for update will prevent concurrent updating of the row, while allowing queries utilizing that row to succeed. -- Bill Moran Potential Technologies http://www.potentialtech.com