Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: magnus(dot)enbom(at)rockstorm(dot)se
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Date: 2002-08-26 19:54:48
Message-ID: 200208261954.g7QJsmW18141@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-26 20:14:40 Re: Think I see a btree vacuuming bug
Previous Message Joe Conway 2002-08-26 19:52:13 Re: anonymous composite types - how to pass tupdesc to

Browse pgsql-sql by date

  From Date Subject
Next Message h012 2002-08-26 20:12:42 "reverse()" on strings
Previous Message Magnus Enbom 2002-08-26 19:50:27 Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?