Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
360e61e1
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,发现更多精彩内容 >>
提交
360e61e1
编写于
10月 14, 2001
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update FAQ.
上级
1ebc028c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
16 deletion
+8
-16
doc/FAQ
doc/FAQ
+4
-8
doc/src/FAQ/FAQ.html
doc/src/FAQ/FAQ.html
+4
-8
未找到文件。
doc/FAQ
浏览文件 @
360e61e1
Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: S
at Oct 13 01:26:55
EDT 2001
Last updated: S
un Oct 14 19:27:20
EDT 2001
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
...
...
@@ -826,10 +826,8 @@ BYTEA bytea variable-length byte array (null-safe)
object with the nextval() function before inserting and then insert it
explicitly. Using the example table in 4.16.1, that might look like
this in Perl:
$sql = "SELECT nextval('person_id_seq')";
$newSerialID = ($conn->selectrow_array($sql))[0];
INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
$res = $dbh->do($sql);
new_id = output of "SELECT nextval('person_id_seq')"
INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal');
You would then also have the new value stored in $newSerialID for use
in other queries (e.g., as a foreign key to the person table). Note
...
...
@@ -840,9 +838,7 @@ BYTEA bytea variable-length byte array (null-safe)
Alternatively, you could retrieve the assigned SERIAL value with the
currval() function after it was inserted by default, e.g.,
INSERT INTO person (name) VALUES ('Blaise Pascal');
$res = $conn->do($sql);
$sql = "SELECT currval('person_id_seq')";
$newSerialID = ($conn->selectrow_array($sql))[0];
new_id = output of "SELECT currval('person_id_seq')";
Finally, you could use the OID returned from the INSERT statement to
look up the default value, though this is probably the least portable
...
...
doc/src/FAQ/FAQ.html
浏览文件 @
360e61e1
...
...
@@ -12,7 +12,7 @@
alink=
"#0000FF"
>
<H1>
Frequently Asked Questions (FAQ) for PostgreSQL
</H1>
<P>
Last updated: S
at Oct 13 01:26:55
EDT 2001
</P>
<P>
Last updated: S
un Oct 14 19:27:20
EDT 2001
</P>
<P>
Current maintainer: Bruce Momjian (
<A
href=
"mailto:pgman@candle.pha.pa.us"
>
pgman@candle.pha.pa.us
</A>
)
<BR>
...
...
@@ -1050,10 +1050,8 @@ BYTEA bytea variable-length byte array (null-safe)
example table in
<A
href=
"#4.16.1"
>
4.16.1
</A>
, that might look like
this in Perl:
</P>
<PRE>
$sql = "SELECT nextval('person_id_seq')";
$newSerialID = ($conn->selectrow_array($sql))[0];
INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
$res = $dbh->do($sql);
new_id = output of "SELECT nextval('person_id_seq')"
INSERT INTO person (id, name) VALUES (new_id, 'Blaise Pascal');
</PRE>
You would then also have the new value stored in
<CODE>
$newSerialID
</CODE>
for use in other queries (e.g., as a
...
...
@@ -1068,9 +1066,7 @@ BYTEA bytea variable-length byte array (null-safe)
<I>
after
</I>
it was inserted by default, e.g.,
</P>
<PRE>
INSERT INTO person (name) VALUES ('Blaise Pascal');
$res = $conn->do($sql);
$sql = "SELECT currval('person_id_seq')";
$newSerialID = ($conn->selectrow_array($sql))[0];
new_id = output of "SELECT currval('person_id_seq')";
</PRE>
Finally, you could use the
<A
href=
"#4.17"
><SMALL>
OID
</SMALL></A>
returned from the
<SMALL>
INSERT
</SMALL>
statement to look up the
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录