Re: To Postgres Devs : Wouldn't changing the select limit

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jochem van Dieten <jochemd(at)oli(dot)tudelft(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: To Postgres Devs : Wouldn't changing the select limit
Date: 2001-10-20 02:42:10
Message-ID: 200110200242.f9K2gAx26938@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Bruce Momjian wrote:
>
> >>
> >>>IMHO "LIMIT n OFFSET n" is far more readable than "LIMIT m,n" anyway.
> >>>(Quick: which number is first in the comma version? By what reasoning
> >>>could you deduce that if you'd forgotten?) So I think we should
> >>>deprecate and eventually eliminate the comma version, if we're not
> >>>going to conform to the de facto standard for it.
> >>
> >>I agree that LIMIT n OFFSET n is by far the most readable format, and is
> >>therefore the desirable format. But I am not sure about deprecating and
> >>eliminating the other syntax. Above all it should be avoided that it is
> >>now deprecated but is included in the next SQL standard and has to be
> >>added again.
> >
> > I am confused. While LIMIT and OFFSET may are potential SQL standard
> > reserved words, I don't see how LIMIT #,# would ever be a standard
> > specification. Do you see this somewhere I am missing. Again, LIMIT
> > #,# is the only syntax we are removing.
>
>
> If you are confident that LIMIT #,# would never be an official SQL
> standard who am I to second guess that ;) I don't see that possibility
> anywhere either, but I just wanted to make sure. The possibility that it
> might become an official standard is the only objection I had against
> deprecating and eventual elimination of that syntax.
>
> LIMIT # OFFSET # has my vote.

OK, we have received only one vote to keep LIMIT #,# working for one
more release, and several to remove it so I am committing a patch now to
remove LIMIT #,# and instead have them use LIMIT # OFFSET #:

test=> select * from pg_class LIMIT 1,1;
ERROR: LIMIT #,# syntax no longer supported. Use LIMIT # OFFSET #.

This message will not be removed in later releases because people
porting from MySQL will need to have it there even after our users have
ported their queries.

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-10-20 02:51:15 Re: To Postgres Devs : Wouldn't changing the select limit
Previous Message speedboy 2001-10-20 01:18:35 Re: phpPgAdmin 2.3 build broken?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-10-20 02:51:15 Re: To Postgres Devs : Wouldn't changing the select limit
Previous Message Bill Studenmund 2001-10-20 01:40:04 Re: Package support for Postgres