Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E4FC6475C67 for ; Mon, 26 Aug 2002 15:54:55 -0400 (EDT) Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id A50AA475C3E for ; Mon, 26 Aug 2002 15:54:54 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g7QJsmW18141; Mon, 26 Aug 2002 15:54:48 -0400 (EDT) From: Bruce Momjian Message-Id: <200208261954.g7QJsmW18141@candle.pha.pa.us> Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1? In-Reply-To: <20020826215027.A15218@ford.rockstorm.se> To: magnus.enbom@rockstorm.se Date: Mon, 26 Aug 2002 15:54:48 -0400 (EDT) Cc: Jan Wieck , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/356 X-Sequence-Number: 9202 Magnus Enbom wrote: > On Mon, Aug 26, 2002 at 02:42:26PM -0400, Jan Wieck wrote: > > Bruce Momjian wrote: > > > > > > I found this email from April. It properly points out that our > > > LIMIT/FOR UPDATE ordering doesn't match MySQL's, and MySQL's looks more > > > correct, specifically that the FOR UPDATE is after the LIMIT. Our > > > grammar is: > > > > How do you define "correct" for "non-standard" features? And why don't > > you ask Monty first to change to our "de-facto-standard"? ;-) > > Already done that. ;-) > He said he would look into it(having MySQL accept both behaviors), but if > it would require a big change of their grammar(for a value of big), he'd rather > not. He also pointed out(as Bruce and Tom have done) that our(PG) way is > kind of backwards. > If you look at Oracle, you can see that they also have it last: > > select :== subquery -> for_update_clause ; > > OTOH, Oracle doesn't have LIMIT, but that's another story... > Yep, we clearly have it backwards. Now, how to address it: 1) leave it unchanged 2) allow only new ordering 3) allow both orderings for one release 4) allow both ordering forever -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073