Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
6a7bb0af
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,发现更多精彩内容 >>
提交
6a7bb0af
编写于
10月 11, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prevent tv_sec from becoming negative in connection timeout code.
上级
c2311337
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
68 addition
and
27 deletion
+68
-27
doc/src/FAQ/FAQ.html
doc/src/FAQ/FAQ.html
+14
-5
src/backend/nodes/nodes.c
src/backend/nodes/nodes.c
+2
-12
src/backend/utils/mmgr/mcxt.c
src/backend/utils/mmgr/mcxt.c
+24
-1
src/include/nodes/nodes.h
src/include/nodes/nodes.h
+19
-6
src/include/utils/palloc.h
src/include/utils/palloc.h
+4
-1
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+5
-2
未找到文件。
doc/src/FAQ/FAQ.html
浏览文件 @
6a7bb0af
...
...
@@ -143,6 +143,7 @@
from a function?
<BR>
<A
href=
"#4.26"
>
4.26
</A>
) Why can't I reliably create/drop
temporary tables in PL/PgSQL functions?
<BR>
<A
href=
"#4.27"
>
4.27
</A>
) What replication options are available?
<BR>
<H2
align=
"center"
>
Extending PostgreSQL
</H2>
...
...
@@ -1346,12 +1347,14 @@ BYTEA bytea variable-length byte array (null-byte safe)
<H4><A
name=
"4.24"
>
4.24
</A>
) How do I perform queries using
multiple databases?
</H4>
<P>
There is no way to query a
ny database except
the current one.
<P>
There is no way to query a
database other than
the current one.
Because PostgreSQL loads database-specific system catalogs, it is
uncertain how a cross-database query should even behave.
</P>
<P>
Of course, a client can make simultaneous connections to
different databases and merge the information that way.
</P>
<P><I>
/contrib/dblink
</I>
allows cross-database queries using
function calls. Of course, a client can make simultaneous
connections to different databases and merge the results on the
client side.
</P>
<H4><A
name=
"4.25"
>
4.25
</A>
) How do I return multiple rows or
columns from a function?
</H4>
...
...
@@ -1364,13 +1367,19 @@ BYTEA bytea variable-length byte array (null-byte safe)
<H4><A
name=
"4.26"
>
4.26
</A>
) Why can't I reliably create/drop
temporary tables in PL/PgSQL functions?
</H4>
PL/PgSQL caches function contents, and an unfortunate side effect
<P>
PL/PgSQL caches function contents, and an unfortunate side effect
is that if a PL/PgSQL function accesses a temporary table, and that
table is later dropped and recreated, and the function called
again, the function will fail because the cached function contents
still point to the old temporary table. The solution is to use
<SMALL>
EXECUTE
</SMALL>
for temporary table access in PL/PgSQL. This
will cause the query to be reparsed every time.
will cause the query to be reparsed every time.
</P>
<H4><A
name=
"4.27"
>
4.27
</A>
) What replication options are available?
</H4>
<P>
There are several master/slave replication solutions available.
These allow only one server to make database changes and the slave
merely allow database reading.
<HR>
...
...
src/backend/nodes/nodes.c
浏览文件 @
6a7bb0af
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.1
5 2002/06/20 20:29:29
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.1
6 2002/10/11 04:12:14
momjian Exp $
*
* HISTORY
* Andrew Yu Oct 20, 1994 file creation
...
...
@@ -28,15 +28,5 @@
* macro makeNode. eg. to create a Resdom node, use makeNode(Resdom)
*
*/
Node
*
newNode
(
Size
size
,
NodeTag
tag
)
{
Node
*
newNode
;
Node
*
newNodeMacroHolder
;
Assert
(
size
>=
sizeof
(
Node
));
/* need the tag, at least */
newNode
=
(
Node
*
)
palloc
(
size
);
MemSet
((
char
*
)
newNode
,
0
,
size
);
newNode
->
type
=
tag
;
return
newNode
;
}
src/backend/utils/mmgr/mcxt.c
浏览文件 @
6a7bb0af
...
...
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.3
2 2002/08/12 00:36:12 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.3
3 2002/10/11 04:12:14 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -452,6 +452,29 @@ MemoryContextAlloc(MemoryContext context, Size size)
return
(
*
context
->
methods
->
alloc
)
(
context
,
size
);
}
/*
* MemoryContextAllocZero
* Like MemoryContextAlloc, but clears allocated memory
*
* We could just call MemoryContextAlloc then clear the memory, but this
* function is called too many times, so we have a separate version.
*/
void
*
MemoryContextAllocZero
(
MemoryContext
context
,
Size
size
)
{
void
*
ret
;
AssertArg
(
MemoryContextIsValid
(
context
));
if
(
!
AllocSizeIsValid
(
size
))
elog
(
ERROR
,
"MemoryContextAllocZero: invalid request size %lu"
,
(
unsigned
long
)
size
);
ret
=
(
*
context
->
methods
->
alloc
)
(
context
,
size
);
MemSet
(
ret
,
0
,
size
);
return
ret
;
}
/*
* pfree
* Release an allocated chunk.
...
...
src/include/nodes/nodes.h
浏览文件 @
6a7bb0af
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.11
8 2002/08/31 22:10:47 tgl
Exp $
* $Id: nodes.h,v 1.11
9 2002/10/11 04:12:14 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -261,6 +261,24 @@ typedef struct Node
#define nodeTag(nodeptr) (((Node*)(nodeptr))->type)
/*
* There is no way to dereference the palloc'ed pointer to assign the
* tag, and return the pointer itself, so we need a holder variable.
* Fortunately, this function isn't recursive so we just define
* a global variable for this purpose.
*/
extern
Node
*
newNodeMacroHolder
;
#define newNode(size, tag) \
( \
AssertMacro((size) >= sizeof(Node)),
/* need the tag, at least */
\
\
newNodeMacroHolder = (Node *) palloc0(size), \
newNodeMacroHolder->type = (tag), \
newNodeMacroHolder \
)
#define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_))
#define NodeSetTag(nodeptr,t) (((Node*)(nodeptr))->type = (t))
...
...
@@ -282,11 +300,6 @@ typedef struct Node
* ----------------------------------------------------------------
*/
/*
* nodes/nodes.c
*/
extern
Node
*
newNode
(
Size
size
,
NodeTag
tag
);
/*
* nodes/{outfuncs.c,print.c}
*/
...
...
src/include/utils/palloc.h
浏览文件 @
6a7bb0af
...
...
@@ -21,7 +21,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: palloc.h,v 1.
19 2002/06/20 20:29:53
momjian Exp $
* $Id: palloc.h,v 1.
20 2002/10/11 04:12:14
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -46,9 +46,12 @@ extern DLLIMPORT MemoryContext CurrentMemoryContext;
* Fundamental memory-allocation operations (more are in utils/memutils.h)
*/
extern
void
*
MemoryContextAlloc
(
MemoryContext
context
,
Size
size
);
extern
void
*
MemoryContextAllocZero
(
MemoryContext
context
,
Size
size
);
#define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz))
#define palloc0(sz) MemoryContextAllocZero(CurrentMemoryContext, (sz))
extern
void
pfree
(
void
*
pointer
);
extern
void
*
repalloc
(
void
*
pointer
,
Size
size
);
...
...
src/interfaces/libpq/fe-connect.c
浏览文件 @
6a7bb0af
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.20
6 2002/10/03 17:09:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.20
7 2002/10/11 04:12:14
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1131,7 +1131,10 @@ connectDBComplete(PGconn *conn)
return
0
;
}
remains
.
tv_sec
=
finish_time
-
current_time
;
if
(
finish_time
>
current_time
)
remains
.
tv_sec
=
finish_time
-
current_time
;
else
remains
.
tv_sec
=
0
;
remains
.
tv_usec
=
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录