Re: Re: Use of the LIMIT clause ?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Richard Poole <richard(dot)poole(at)vi(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Re: Use of the LIMIT clause ?
Date: 2001-05-04 22:08:34
Message-ID: 200105042208.f44M8Y121254@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

[ Charset ISO-8859-1 unsupported, converting... ]
> On Mon, Mar 12, 2001 at 09:21:58PM -0500, Tom Lane wrote:
> > Spy <spy(at)joystick(dot)fr> writes:
> > > Tom Lane a ?crit :
> > >> Is that actually how MySQL interprets two parameters? We treat them
> > >> as count and offset respectively, which definition I thought was the
> > >> same as MySQL's.
> >
> > > But MySQL's syntax is different, as found on
> > > http://www.mysql.com/doc/S/E/SELECT.html :
> > > "SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT]
> > > [SQL_BUFFER_RESULT]
> > > [...]
> > > [LIMIT [offset,] rows]"
> >
> > That's annoying; looks like we do it backwards from MySQL. Can anyone
> > confirm that this is how MySQL behaves (maybe it's a typo on this
> > documentation page)?
>
> Yes, it does behave as documented.
>
> > Should we consider changing ours if it is different?
>
> I don't know that it's worth it... it seems to inconvenience some
> people either way. I may soon be moving a moderately complex system
> from MySQL to Postgres and it wouldn't be the end of my world if
> I had to reverse all the LIMITs.
>

Added to TODO. If we took the feature from MySQL, seems we should match
it. This will require a clear notice in the release notes:

* Change LIMIT val,val to be offset,limit to match MySQL

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Davis 2001-05-04 23:55:55 RE: URGENT HELP NEEDED
Previous Message Oliver Vecernik 2001-05-04 21:49:22 Re: Queries

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-05-04 22:24:09 Re: [SQL] delete with cascade
Previous Message Stephan Szabo 2001-05-04 22:06:24 Re: delete with cascade