Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
f363b317
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f363b317
编写于
10月 20, 2001
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion.
上级
424d9389
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
14 addition
and
15 deletion
+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
未找到文件。
HISTORY
浏览文件 @
f363b317
...
...
@@ -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.
...
...
doc/src/sgml/ref/select.sgml
浏览文件 @
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
-->
...
...
@@ -29,7 +29,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</replaceable> ]
[ ORDER BY <replaceable class="PARAMETER">expression</replaceable> [ ASC | DESC | USING <replaceable class="PARAMETER">operator</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> ]
where <replaceable class="PARAMETER">from_item</replaceable> can be:
...
...
@@ -614,7 +614,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<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> ] [, ...] ]
[ 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> ]
</synopsis>
...
...
@@ -664,7 +664,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<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> ] [, ...] ]
[ 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> ]
</synopsis>
...
...
@@ -705,7 +705,7 @@ SELECT name FROM distributors ORDER BY code;
<synopsis>
<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> ] [, ...] ]
[ 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> ]
</synopsis>
...
...
@@ -742,7 +742,7 @@ SELECT name FROM distributors ORDER BY code;
</title>
<para>
<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>
</synopsis>
...
...
doc/src/sgml/sql.sgml
浏览文件 @
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">
...
...
@@ -864,7 +864,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
[ { UNION | INTERSECT | EXCEPT [ ALL ] } <replaceable class="PARAMETER">select</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> [, ...] ] ]
[ 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> ]
</synopsis>
</para>
...
...
src/backend/parser/gram.y
浏览文件 @
f363b317
...
...
@@ -11,7 +11,7 @@
*
*
* 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
* 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
...
...
src/test/regress/expected/limit.out
浏览文件 @
f363b317
...
...
@@ -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
...
...
src/test/regress/sql/limit.sql
浏览文件 @
f363b317
...
...
@@ -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
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录