X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C105E5E46F7 for ; Tue, 17 Aug 2004 11:51:25 -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 06113-10 for ; Tue, 17 Aug 2004 14:51:26 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 3DEA55E46BF for ; Tue, 17 Aug 2004 11:51:23 -0300 (ADT) Received: from [62.165.4.166] (dicaprio.akademie1.de [62.165.4.166]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id i7HEpQg10115; Tue, 17 Aug 2004 16:51:26 +0200 Subject: Re: SELECT MAX(c) FROM (SELECT ... FOR UPDATE) AS foo From: Markus Bertheau To: Jean-Luc Lachance Cc: pgsql-sql@postgresql.org In-Reply-To: <41221580.7070907@sympatico.ca> References: <1092740863.2627.17.camel@dicaprio.akademie1.de> <41221580.7070907@sympatico.ca> Content-Type: text/plain; charset=UTF-8 Message-Id: <1092754281.2627.28.camel@dicaprio.akademie1.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 17 Aug 2004 16:51:21 +0200 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/169 X-Sequence-Number: 18666 =D0=92 =D0=92=D1=82=D1=80, 17.08.2004, =D0=B2 16:26, Jean-Luc Lachance =D0= =BF=D0=B8=D1=88=D0=B5=D1=82: > This query does not make sense to me. > Why would you create an updatable subquery just to get the highest value? To make sure that the highest value will be the highest value (or then second-highest) after I commit the transaction. See my other answer. --=20 Markus Bertheau