diff --git a/HISTORY b/HISTORY
index 118d564420..0b4bf86346 100644
--- a/HISTORY
+++ b/HISTORY
@@ -38,9 +38,8 @@ Migration to 7.2
A dump/restore using pg_dump is required for those wishing to migrate
data from any previous release. One significant change is that
- SELECT ... LIMIT 10,20 now uses the 10 as the OFFSET and the 20 as
- the LIMIT. Previous versions had this reversed. This change was
- made for MySQL compatibility.
+ the SELECT ... LIMIT 10,20 syntax is no longer supported. You must
+ now use LIMIT 10 OFFSET 20 to accomplish the same thing.
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index e8dc02498c..93a491a328 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -1,5 +1,5 @@
@@ -29,7 +29,7 @@ SELECT [ ALL | DISTINCT [ ON ( expressionselect ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
[ FOR UPDATE [ OF tablename [, ...] ] ]
- [ LIMIT [ start , ] { count | ALL } ]
+ [ LIMIT { count | ALL } ]
[ OFFSET start ]
where from_item can be:
@@ -614,7 +614,7 @@ SELECT name FROM distributors ORDER BY code;
table_query UNION [ ALL ] table_query
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
- [ LIMIT [ start , ] { count | ALL } ]
+ [ LIMIT { count | ALL } ]
[ OFFSET start ]
@@ -664,7 +664,7 @@ SELECT name FROM distributors ORDER BY code;
table_query INTERSECT [ ALL ] table_query
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
- [ LIMIT [ start , ] { count | ALL } ]
+ [ LIMIT { count | ALL } ]
[ OFFSET start ]
@@ -705,7 +705,7 @@ SELECT name FROM distributors ORDER BY code;
table_query EXCEPT [ ALL ] table_query
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
- [ LIMIT [ start , ] { count | ALL } ]
+ [ LIMIT { count | ALL } ]
[ OFFSET start ]
@@ -742,7 +742,7 @@ SELECT name FROM distributors ORDER BY code;
- LIMIT [ start , ] { count | ALL }
+ LIMIT { count | ALL }
OFFSET start
diff --git a/doc/src/sgml/sql.sgml b/doc/src/sgml/sql.sgml
index 223aee1bc6..8ea411f36f 100644
--- a/doc/src/sgml/sql.sgml
+++ b/doc/src/sgml/sql.sgml
@@ -1,5 +1,5 @@
@@ -864,7 +864,7 @@ SELECT [ ALL | DISTINCT [ ON ( expressionselect ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [, ...] ]
[ FOR UPDATE [ OF class_name [, ...] ] ]
- [ LIMIT [ start , ] { count | ALL } ]
+ [ LIMIT { count | ALL } ]
[ OFFSET start ]
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 4f5f5d6b7e..0db5bcd714 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.265 2001/10/20 01:02:14 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.266 2001/10/20 02:55:39 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -3648,7 +3648,7 @@ OptUseOp: USING all_Op { $$ = $2; }
select_limit: LIMIT select_offset_value ',' select_limit_value
- { $$ = makeList2($2, $4); }
+ { elog(ERROR,"LIMIT #,# syntax no longer supported. Use LIMIT # OFFSET #."); }
| LIMIT select_limit_value OFFSET select_offset_value
{ $$ = makeList2($4, $2); }
| LIMIT select_limit_value
diff --git a/src/test/regress/expected/limit.out b/src/test/regress/expected/limit.out
index c99e094156..f960958b2f 100644
--- a/src/test/regress/expected/limit.out
+++ b/src/test/regress/expected/limit.out
@@ -98,7 +98,7 @@ SELECT ''::text AS five, unique1, unique2, stringu1
SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek
- ORDER BY unique1 LIMIT 900, 5;
+ ORDER BY unique1 LIMIT 5 OFFSET 900;
five | unique1 | unique2 | stringu1
------+---------+---------+----------
| 900 | 913 | QIAAAA
diff --git a/src/test/regress/sql/limit.sql b/src/test/regress/sql/limit.sql
index 99842af2f6..c15a486aff 100644
--- a/src/test/regress/sql/limit.sql
+++ b/src/test/regress/sql/limit.sql
@@ -29,4 +29,4 @@ SELECT ''::text AS five, unique1, unique2, stringu1
ORDER BY unique1 OFFSET 990 LIMIT 5;
SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek
- ORDER BY unique1 LIMIT 900, 5;
+ ORDER BY unique1 LIMIT 5 OFFSET 900;