Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8F7BB475C67 for ; Mon, 26 Aug 2002 14:42:30 -0400 (EDT) Received: from smtp012.mail.yahoo.com (smtp012.mail.yahoo.com [216.136.173.32]) by postgresql.org (Postfix) with SMTP id C39C6475B4A for ; Mon, 26 Aug 2002 14:42:29 -0400 (EDT) Received: from psc.progress.com (HELO Yahoo.com) (janwieck@192.233.92.200 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 26 Aug 2002 18:42:30 -0000 Message-ID: <3D6A7692.2F43B18@Yahoo.com> Date: Mon, 26 Aug 2002 14:42:26 -0400 From: Jan Wieck X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.2.14-6.1.1smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Momjian Cc: magnus.enbom@rockstorm.se, pgsql-sql@postgresql.org Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1? References: <200208260031.g7Q0VCC24924@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/352 X-Sequence-Number: 9198 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"? ;-) Jan > > | select_clause sort_clause opt_for_update_clause opt_select_limit > > How do we want to deal with this? I tried allowing both orderings with > the attached patch but got: > > bison -y -d gram.y > conflicts: 4 shift/reduce, 5 reduce/reduce > > --------------------------------------------------------------------------- > > Magnus Enbom wrote: > > Hi, > > > > I've just been hit by a small but annoying difference between postgres(7.2) > > and mysql(4.x). > > In postgresql you do: > > > > SELECT * FROM table FOR UPDATE LIMIT 1; > > > > and in mysql you do: > > > > SELECT * FROM table LIMIT 1 FOR UPDATE; > > > > Is it possible for postgres to accept the mysql syntax as well? > > It's not that many databases that implement LIMIT, so it would be nice if the > > ones that do have the same syntax(or can accept each others variants). > > > > -- Magnus > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > > > -- > 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 > > ------------------------------------------------------------------------ > Name: /bjm/diff > /bjm/diff Type: Plain Text (text/plain) > Encoding: 7bit > > Part 1.3 Type: Plain Text (text/plain) > Encoding: 8bit -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #