Received: from smtp-relay.noc.dsvr.net (smtp-relay.noc.dsvr.net [212.69.192.4]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1IFk7E02328 for ; Mon, 18 Feb 2002 10:46:07 -0500 (EST) (envelope-from me@shanewright.co.uk) Received: from [212.69.206.2] (helo=fullerruss.dsvr.co.uk) by smtp-relay.noc.dsvr.net with esmtp (Exim 3.16 #1) id 16cpzX-000EBA-00; Mon, 18 Feb 2002 15:46:11 +0000 Received: from there (host213-122-81-43.in-addr.btopenworld.com [213.122.81.43] (may be forged)) by fullerruss.dsvr.co.uk (8.11.3/8.11.1) with SMTP id g1IFk4l28406; Mon, 18 Feb 2002 15:46:10 GMT Message-Id: <200202181546.g1IFk4l28406@fullerruss.dsvr.co.uk> Content-Type: text/plain; charset="iso-8859-1" From: Shane Wright Reply-To: me@shanewright.co.uk To: Tom Lane Subject: Re: table locking Date: Mon, 18 Feb 2002 15:46:16 +0000 X-Mailer: KMail [version 1.3.2] Cc: pgsql-sql@postgresql.org References: <200202181516.g1IFGF517803@candle.pha.pa.us> <200202181521.g1IFLwk24097@fullerruss.dsvr.co.uk> <11225.1014046976@sss.pgh.pa.us> In-Reply-To: <11225.1014046976@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/216 X-Sequence-Number: 6640 Hi Tom, Thanks for the input, but I specifically can't use SELECT.. FOR UPDATE as the SELECT won't match any rows (it isnt supposed to, there's an explanation as to in a post I've just sent). I had thought about ACCESS EXCLUSIVE MODE; but it looks like it'll block all other readers as well, which isn't necessary. Thanks -- Shane On Monday 18 Feb 2002 3:42 pm, Tom Lane wrote: > I think you want just LOCK TABLE tab IN SHARE ROW EXCLUSIVE MODE > or LOCK TABLE tab IN EXCLUSIVE MODE. The latter would lock out > SELECT FOR UPDATE, the former wouldn't. > > regards, tom lane