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

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

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> If you're going to do that, *please* suggest the *correct* substitution.
>> AFAICT, our version of LIMIT m,n transposes to OFFSET m LIMIT n; but
>> your message suggests the opposite.

> Remember, the 7.1 code was:

> ! select_limit: LIMIT select_limit_value ',' select_offset_value
> ! { $$ = makeList2($4, $2); }

> This was changed a few weeks ago to match MySQL, and only today removed.

Wups, you're right, I was looking at the cvs-tip code not 7.1.
What was that about the order not being easy to remember? :-(

> However, our new message suggests the old PostgreSQL syntax, not the
> MySQL syntax. Optimally we should ship with this ordering for 7.2 and
> reverse it for 7.3 or 7.4.

Actually, it seems that the message should point out *both* the
old-Postgres and the MySQL translations. One camp or the other
is going to get burnt otherwise. Maybe:

ERROR: LIMIT #,# syntax no longer supported. Use LIMIT # OFFSET #.
If translating pre-7.2 Postgres: LIMIT m,n => LIMIT m OFFSET n
If translating MySQL: LIMIT m,n => OFFSET m LIMIT n

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erol Öz 2001-10-20 06:16:11 pg_dump,
Previous Message Bruce Momjian 2001-10-20 04:54:41 Re: To Postgres Devs : Wouldn't changing the select limit

Browse pgsql-hackers by date

  From Date Subject
Next Message Flancer 2001-10-20 07:27:02 Re: To Postgres Devs : Wouldn't changing the select limit
Previous Message Bruce Momjian 2001-10-20 04:54:41 Re: To Postgres Devs : Wouldn't changing the select limit