Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
7e1955b8
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,发现更多精彩内容 >>
提交
7e1955b8
编写于
1月 16, 2014
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: update PL/pgSQL docs about the use of := and =
上级
a472ae1e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
7 deletion
+17
-7
doc/src/sgml/plpgsql.sgml
doc/src/sgml/plpgsql.sgml
+11
-6
src/pl/plpgsql/src/pl_gram.y
src/pl/plpgsql/src/pl_gram.y
+6
-1
未找到文件。
doc/src/sgml/plpgsql.sgml
浏览文件 @
7e1955b8
...
...
@@ -328,7 +328,7 @@ arow RECORD;
<para>
The general syntax of a variable declaration is:
<synopsis>
<replaceable>name</replaceable> <optional> CONSTANT </optional> <replaceable>type</replaceable> <optional> COLLATE <replaceable>collation_name</replaceable> </optional> <optional> NOT NULL </optional> <optional> { DEFAULT | := } <replaceable>expression</replaceable> </optional>;
<replaceable>name</replaceable> <optional> CONSTANT </optional> <replaceable>type</replaceable> <optional> COLLATE <replaceable>collation_name</replaceable> </optional> <optional> NOT NULL </optional> <optional> { DEFAULT | :=
| =
} <replaceable>expression</replaceable> </optional>;
</synopsis>
The <literal>DEFAULT</> clause, if given, specifies the initial value assigned
to the variable when the block is entered. If the <literal>DEFAULT</> clause
...
...
@@ -343,6 +343,8 @@ arow RECORD;
is specified, an assignment of a null value results in a run-time
error. All variables declared as <literal>NOT NULL</>
must have a nonnull default value specified.
Equals (<literal>=</>) can be used instead of PL/SQL-compliant
<literal>:=</>.
</para>
<para>
...
...
@@ -866,7 +868,7 @@ PREPARE <replaceable>statement_name</>(integer, integer) AS SELECT $1 < $2;
An assignment of a value to a <application>PL/pgSQL</application>
variable is written as:
<synopsis>
<replaceable>variable</replaceable>
:=
<replaceable>expression</replaceable>;
<replaceable>variable</replaceable>
{ := | = }
<replaceable>expression</replaceable>;
</synopsis>
As explained previously, the expression in such a statement is evaluated
by means of an SQL <command>SELECT</> command sent to the main
...
...
@@ -874,7 +876,8 @@ PREPARE <replaceable>statement_name</>(integer, integer) AS SELECT $1 < $2;
a row value, if the variable is a row or record variable). The target
variable can be a simple variable (optionally qualified with a block
name), a field of a row or record variable, or an element of an array
that is a simple variable or field.
that is a simple variable or field. Equals (<literal>=</>) can be
used instead of PL/SQL-compliant <literal>:=</>.
</para>
<para>
...
...
@@ -1411,7 +1414,7 @@ EXECUTE format('UPDATE tbl SET %I = $1 WHERE key = $2', colname)
command, which has the form:
<synopsis>
GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable>
=
<replaceable>item</replaceable> <optional> , ... </optional>;
GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable>
{ = | := }
<replaceable>item</replaceable> <optional> , ... </optional>;
</synopsis>
This command allows retrieval of system status indicators. Each
...
...
@@ -1425,6 +1428,8 @@ GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceabl
<acronym>SQL</acronym> command. Note that <varname>RESULT_OID</>
is only useful after an <command>INSERT</command> command into a
table containing OIDs.
Equals (<literal>:=</>) can be used instead of SQL-standard
<literal>=</> for <command>GET DIAGNOSTICS</>.
</para>
<para>
...
...
@@ -2672,7 +2677,7 @@ SELECT merge_db(1, 'dennis');
<command>GET STACKED DIAGNOSTICS</command> command, which has the form:
<synopsis>
GET STACKED DIAGNOSTICS <replaceable>variable</replaceable>
=
<replaceable>item</replaceable> <optional> , ... </optional>;
GET STACKED DIAGNOSTICS <replaceable>variable</replaceable>
{ = | := }
<replaceable>item</replaceable> <optional> , ... </optional>;
</synopsis>
Each <replaceable>item</replaceable> is a key word identifying a status
...
...
@@ -2776,7 +2781,7 @@ END;
<para>
<synopsis>
GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable>
=
<replaceable>PG_CONTEXT</replaceable> <optional> , ... </optional>;
GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable>
{ = | := }
<replaceable>PG_CONTEXT</replaceable> <optional> , ... </optional>;
</synopsis>
...
...
src/pl/plpgsql/src/pl_gram.y
浏览文件 @
7e1955b8
...
...
@@ -796,7 +796,12 @@ decl_defkey : assign_operator
| K_DEFAULT
;
assign_operator : '=' /* not documented because it might be removed someday */
/*
* Ada-based PL/SQL uses := for assignment and variable defaults, while
* the SQL standard uses equals for these cases and for GET
* DIAGNOSTICS, so we support both. FOR and OPEN only support :=.
*/
assign_operator : '='
| COLON_EQUALS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录