X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DCB9153E18 for ; Mon, 9 May 2005 16:02:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72258-10 for ; Mon, 9 May 2005 19:02:31 +0000 (GMT) Received: from cmailg4.svr.pol.co.uk (cmailg4.svr.pol.co.uk [195.92.195.174]) by svr1.postgresql.org (Postfix) with ESMTP id 4C12553609 for ; Mon, 9 May 2005 16:02:30 -0300 (ADT) Received: from modem-2119.lemur.dialup.pol.co.uk ([217.135.136.71] helo=192.168.0.102) by cmailg4.svr.pol.co.uk with esmtp (Exim 4.41) id 1DVDWM-0002KI-DU; Mon, 09 May 2005 20:02:26 +0100 Subject: Re: Concurrency From: Simon Riggs To: Kris Kiger Cc: pgsql-admin@postgresql.org In-Reply-To: <427F9C06.3070206@musicrebellion.com> References: <671060015.20031010095617@roaddep.ru> <427F9C06.3070206@musicrebellion.com> Content-Type: text/plain Organization: 2nd Quadrant Date: Mon, 09 May 2005 19:58:43 +0100 Message-Id: <1115665123.3830.38.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/95 X-Sequence-Number: 17524 On Mon, 2005-05-09 at 12:21 -0500, Kris Kiger wrote: > Quick question. I lock a table, call it table X, and then issue two > updates on that table. The two updates are left waiting. I then unlock > the table. The two updates go through. My question is, is there a > predictable way to determine which query will be executed first? Thanks > in advance The lock queue is served in FIFO sequence. It is predictable, but if you don't know which order they were submitted in it might be hard to determine what that predictable order is, if they were submitted almost at the same time. ...but you shouldn't use locking as a queuing mechanism. Best Regards, Simon Riggs