Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f363b317
Commit
f363b317
authored
Oct 20, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion.
parent
424d9389
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
15 deletions
+14
-15
HISTORY
HISTORY
+2
-3
doc/src/sgml/ref/select.sgml
doc/src/sgml/ref/select.sgml
+6
-6
doc/src/sgml/sql.sgml
doc/src/sgml/sql.sgml
+2
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+2
-2
src/test/regress/expected/limit.out
src/test/regress/expected/limit.out
+1
-1
src/test/regress/sql/limit.sql
src/test/regress/sql/limit.sql
+1
-1
No files found.
HISTORY
View file @
f363b317
...
@@ -38,9 +38,8 @@ Migration to 7.2
...
@@ -38,9 +38,8 @@ Migration to 7.2
A dump/restore using pg_dump is required for those wishing to migrate
A dump/restore using pg_dump is required for those wishing to migrate
data from any previous release. One significant change is that
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 SELECT ... LIMIT 10,20 syntax is no longer supported. You must
the LIMIT. Previous versions had this reversed. This change was
now use LIMIT 10 OFFSET 20 to accomplish the same thing.
made for MySQL compatibility.
...
...
doc/src/sgml/ref/select.sgml
View file @
f363b317
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.4
7 2001/09/23 03:39:01
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.4
8 2001/10/20 02:55:38
momjian Exp $
Postgres documentation
Postgres documentation
-->
-->
...
@@ -29,7 +29,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
...
@@ -29,7 +29,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</replaceable> ]
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</replaceable> ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ FOR UPDATE [ OF <replaceable class="PARAMETER">tablename</replaceable> [, ...] ] ]
[ FOR UPDATE [ OF <replaceable class="PARAMETER">tablename</replaceable> [, ...] ] ]
[ LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
where <replaceable class="PARAMETER">from_item</replaceable> can be:
where <replaceable class="PARAMETER">from_item</replaceable> can be:
...
@@ -614,7 +614,7 @@ SELECT name FROM distributors ORDER BY code;
...
@@ -614,7 +614,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<synopsis>
<replaceable class="PARAMETER">table_query</replaceable> UNION [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
<replaceable class="PARAMETER">table_query</replaceable> UNION [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
</synopsis>
</synopsis>
...
@@ -664,7 +664,7 @@ SELECT name FROM distributors ORDER BY code;
...
@@ -664,7 +664,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<synopsis>
<replaceable class="PARAMETER">table_query</replaceable> INTERSECT [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
<replaceable class="PARAMETER">table_query</replaceable> INTERSECT [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
</synopsis>
</synopsis>
...
@@ -705,7 +705,7 @@ SELECT name FROM distributors ORDER BY code;
...
@@ -705,7 +705,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<synopsis>
<replaceable class="PARAMETER">table_query</replaceable> EXCEPT [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
<replaceable class="PARAMETER">table_query</replaceable> EXCEPT [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
</synopsis>
</synopsis>
...
@@ -742,7 +742,7 @@ SELECT name FROM distributors ORDER BY code;
...
@@ -742,7 +742,7 @@ SELECT name FROM distributors ORDER BY code;
</title>
</title>
<para>
<para>
<synopsis>
<synopsis>
LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL }
LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL }
OFFSET <replaceable class="PARAMETER">start</replaceable>
OFFSET <replaceable class="PARAMETER">start</replaceable>
</synopsis>
</synopsis>
...
...
doc/src/sgml/sql.sgml
View file @
f363b317
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
2 2001/09/23 03:39:01
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/sql.sgml,v 1.2
3 2001/10/20 02:55:38
momjian Exp $
-->
-->
<chapter id="sql">
<chapter id="sql">
...
@@ -864,7 +864,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
...
@@ -864,7 +864,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</replaceable> ]
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</replaceable> ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</replaceable> ] [, ...] ]
[ FOR UPDATE [ OF <replaceable class="PARAMETER">class_name</replaceable> [, ...] ] ]
[ FOR UPDATE [ OF <replaceable class="PARAMETER">class_name</replaceable> [, ...] ] ]
[ LIMIT
[ <replaceable class="PARAMETER">start</replaceable> , ]
{ <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ LIMIT { <replaceable class="PARAMETER">count</replaceable> | ALL } ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
[ OFFSET <replaceable class="PARAMETER">start</replaceable> ]
</synopsis>
</synopsis>
</para>
</para>
...
...
src/backend/parser/gram.y
View file @
f363b317
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.26
5 2001/10/20 01:02:14 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.26
6 2001/10/20 02:55:39 momjian
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -3648,7 +3648,7 @@ OptUseOp: USING all_Op { $$ = $2; }
...
@@ -3648,7 +3648,7 @@ OptUseOp: USING all_Op { $$ = $2; }
select_limit: LIMIT select_offset_value ',' select_limit_value
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
| LIMIT select_limit_value OFFSET select_offset_value
{ $$ = makeList2($4, $2); }
{ $$ = makeList2($4, $2); }
| LIMIT select_limit_value
| LIMIT select_limit_value
...
...
src/test/regress/expected/limit.out
View file @
f363b317
...
@@ -98,7 +98,7 @@ SELECT ''::text AS five, unique1, unique2, stringu1
...
@@ -98,7 +98,7 @@ SELECT ''::text AS five, unique1, unique2, stringu1
SELECT ''::text AS five, unique1, unique2, stringu1
SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek
FROM onek
ORDER BY unique1 LIMIT
900, 5
;
ORDER BY unique1 LIMIT
5 OFFSET 900
;
five | unique1 | unique2 | stringu1
five | unique1 | unique2 | stringu1
------+---------+---------+----------
------+---------+---------+----------
| 900 | 913 | QIAAAA
| 900 | 913 | QIAAAA
...
...
src/test/regress/sql/limit.sql
View file @
f363b317
...
@@ -29,4 +29,4 @@ SELECT ''::text AS five, unique1, unique2, stringu1
...
@@ -29,4 +29,4 @@ SELECT ''::text AS five, unique1, unique2, stringu1
ORDER
BY
unique1
OFFSET
990
LIMIT
5
;
ORDER
BY
unique1
OFFSET
990
LIMIT
5
;
SELECT
''
::
text
AS
five
,
unique1
,
unique2
,
stringu1
SELECT
''
::
text
AS
five
,
unique1
,
unique2
,
stringu1
FROM
onek
FROM
onek
ORDER
BY
unique1
LIMIT
900
,
5
;
ORDER
BY
unique1
LIMIT
5
OFFSET
900
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment