Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
c0dc44eb
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,发现更多精彩内容 >>
提交
c0dc44eb
编写于
3月 08, 2011
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
A bit more editing for collation documentation.
上级
d367d41d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
11 deletion
+30
-11
doc/src/sgml/syntax.sgml
doc/src/sgml/syntax.sgml
+30
-11
未找到文件。
doc/src/sgml/syntax.sgml
浏览文件 @
c0dc44eb
...
...
@@ -1257,6 +1257,12 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
</para>
</listitem>
<listitem>
<para>
A collation expression
</para>
</listitem>
<listitem>
<para>
A scalar subquery
...
...
@@ -1898,8 +1904,8 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable>
</note>
</sect2>
<sect2 id="sql-syntax-collate-
clause
">
<title>C
OLLATE Clause
</title>
<sect2 id="sql-syntax-collate-
exprs
">
<title>C
ollation Expressions
</title>
<indexterm>
<primary>COLLATE</primary>
...
...
@@ -1925,7 +1931,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable>
</para>
<para>
The two
typical
uses of the <literal>COLLATE</literal> clause are
The two
common
uses of the <literal>COLLATE</literal> clause are
overriding the sort order in an <literal>ORDER BY</> clause, for
example:
<programlisting>
...
...
@@ -1934,15 +1940,28 @@ SELECT a, b, c FROM tbl WHERE ... ORDER BY a COLLATE "C";
and overriding the collation of a function or operator call that
has locale-sensitive results, for example:
<programlisting>
SELECT * FROM tbl WHERE a > 'foo' COLLATE "C";
SELECT * FROM tbl WHERE a > 'foo' COLLATE "C";
</programlisting>
Note that in the latter case the <literal>COLLATE</> clause is
attached to an input argument of the operator we wish to affect.
It doesn't matter which argument of the operator or function call the
<literal>COLLATE</> clause is attached to, because the collation that is
applied by the operator or function is derived by considering all
arguments, and an explicit <literal>COLLATE</> clause will override the
collations of all other arguments. (Attaching non-matching
<literal>COLLATE</> clauses to more than one argument, however, is an
error. For more details see <xref linkend="collation">.)
Thus, this gives the same result as the previous example:
<programlisting>
SELECT * FROM tbl WHERE a COLLATE "C" > 'foo';
</programlisting>
But this is an error:
<programlisting>
SELECT * FROM tbl WHERE (a > 'foo') COLLATE "C";
</programlisting>
In the latter case it doesn't matter which argument of the
operator of function call the <literal>COLLATE</> clause is
attached to, because the collation that is applied by the operator
or function is derived from all arguments, and
the <literal>COLLATE</> clause will override the collations of all
other arguments. Attaching nonmatching <literal>COLLATE</>
clauses to more than one argument, however, is an error.
because it attempts to apply a collation to the result of the
<literal>></> operator, which is of the non-collatable data type
<type>boolean</>.
</para>
</sect2>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录