pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: magnus.enbom@rockstorm.se, Jan Wieck <JanWieck@Yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
Date: Tue, 27 Aug 2002 16:59:20 -0400 (EDT)
Message-ID: <200208272059.g7RKxKc14520@candle.pha.pa.us> (raw)
In-Reply-To: <200208261954.g7QJsmW18141@candle.pha.pa.us>


OK, no one has commented on this, so I guess I am going to have to guess
the group's preference.

My guess, seeing as very few probably use LIMIT and FOR UPDATE together,
is to swap them and document it in the release notes.  Was I correct in
my guess?

---------------------------------------------------------------------------

Bruce Momjian wrote:
> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
  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



view thread (43+ messages)  latest in thread

Message-ID: <200208272059.g7RKxKc14520@candle.pha.pa.us>
Permalink:  ../200208272059.g7RKxKc14520@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200208272059.g7RKxKc14520@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgman@candle.pha.pa.us, JanWieck@Yahoo.com
  Subject: Re: LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?
  In-Reply-To: <200208272059.g7RKxKc14520@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox