Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 95A894765E4 for ; Wed, 28 Aug 2002 10:26:04 -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 A94944765D3 for ; Wed, 28 Aug 2002 10:26:02 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g7SEPuM14920; Wed, 28 Aug 2002 10:25:56 -0400 (EDT) From: Bruce Momjian Message-Id: <200208281425.g7SEPuM14920@candle.pha.pa.us> Subject: Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1? In-Reply-To: <21006.1030543878@sss.pgh.pa.us> To: Tom Lane Date: Wed, 28 Aug 2002 10:25:56 -0400 (EDT) Cc: Larry Rosenman , PostgreSQL-development 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/2051 X-Sequence-Number: 27734 Tom Lane wrote: > Bruce Momjian writes: > > Larry Rosenman wrote: > >> Why? If both old and new are acceptable, why not document it? > >> (Just curious, I'm not wedded to it). > > > Well, showing both versions adds confusion for no good reason, > > Yes, particularly considering that LIMIT ... FOR UPDATE corresponds > to the implementation behavior (LIMIT acts before FOR UPDATE) while > FOR UPDATE ... LIMIT does not. > > I concur with documenting only the preferred form (though there should > be a note in gram.y explaining that we're supporting the old syntax > for backward compatibility). I originally thought the grammar would be ugly to support both, but in fact it has almost the same number of actions as before, so we can keep it around for a while if not forever. I will update the gram.y comments to indicate it will live beyond 7.3.X. -- 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