Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
c4fd93b3
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,发现更多精彩内容 >>
提交
c4fd93b3
编写于
4月 17, 2008
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Re-enable pg_terminate_backend() using SIGTERM. SIGTERM testing still
needed.
上级
c5e4e91a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
19 deletion
+36
-19
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+15
-4
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+9
-1
src/backend/utils/adt/misc.c
src/backend/utils/adt/misc.c
+7
-12
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+3
-1
src/include/utils/builtins.h
src/include/utils/builtins.h
+2
-1
未找到文件。
doc/src/sgml/func.sgml
浏览文件 @
c4fd93b3
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
2 2008/04/15 20:28:46
momjian Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
3 2008/04/17 20:56:41
momjian Exp $ -->
<chapter
id=
"functions"
>
<title>
Functions and Operators
</title>
...
...
@@ -11848,6 +11848,9 @@ SELECT set_config('log_statement_stats', 'off', false);
<indexterm>
<primary>
pg_cancel_backend
</primary>
</indexterm>
<indexterm>
<primary>
pg_terminate_backend
</primary>
</indexterm>
<indexterm>
<primary>
pg_reload_conf
</primary>
</indexterm>
...
...
@@ -11883,6 +11886,13 @@ SELECT set_config('log_statement_stats', 'off', false);
<entry><type>
boolean
</type></entry>
<entry>
Cancel a backend's current query
</entry>
</row>
<row>
<entry>
<literal><function>
pg_terminate_backend
</function>
(
<parameter>
pid
</parameter>
<type>
int
</>
)
</literal>
</entry>
<entry><type>
boolean
</type></entry>
<entry>
Terminate a backend
</entry>
</row>
<row>
<entry>
<literal><function>
pg_reload_conf
</function>
()
</literal>
...
...
@@ -11907,9 +11917,10 @@ SELECT set_config('log_statement_stats', 'off', false);
</para>
<para>
<function>
pg_cancel_backend
</>
sends a query cancel
(
<systemitem>
SIGINT
</>
) signal to a backend process identified by
process ID. The process ID of an active backend can be found from
<function>
pg_cancel_backend
</>
and
<function>
pg_terminate_backend
</>
send signals (
<systemitem>
SIGINT
</>
or
<systemitem>
SIGTERM
</>
respectively) to backend processes identified by process ID.
The process ID of an active backend can be found from
the
<structfield>
procpid
</structfield>
column in the
<structname>
pg_stat_activity
</structname>
view, or by listing the
<command>
postgres
</command>
processes on the server with
...
...
doc/src/sgml/runtime.sgml
浏览文件 @
c4fd93b3
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.41
3 2008/04/15 20:28:46
momjian Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.41
4 2008/04/17 20:56:41
momjian Exp $ -->
<chapter Id="runtime">
<title>Operating System Environment</title>
...
...
@@ -1372,6 +1372,14 @@ $ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput
well.
</para>
</important>
<para>
To terminate a session while allowing other sessions to continue, use
<function>pg_terminate_backend()</> (<xref
linkend="functions-admin-signal-table">) or send a
<systemitem>SIGTERM</> signal to the child process associated with
the session.
</para>
</sect1>
<sect1 id="preventing-server-spoofing">
...
...
src/backend/utils/adt/misc.c
浏览文件 @
c4fd93b3
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.6
1 2008/04/15 20:28:46
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/misc.c,v 1.6
2 2008/04/17 20:56:41
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -128,6 +128,12 @@ pg_cancel_backend(PG_FUNCTION_ARGS)
PG_RETURN_BOOL
(
pg_signal_backend
(
PG_GETARG_INT32
(
0
),
SIGINT
));
}
Datum
pg_terminate_backend
(
PG_FUNCTION_ARGS
)
{
PG_RETURN_BOOL
(
pg_signal_backend
(
PG_GETARG_INT32
(
0
),
SIGTERM
));
}
Datum
pg_reload_conf
(
PG_FUNCTION_ARGS
)
{
...
...
@@ -169,17 +175,6 @@ pg_rotate_logfile(PG_FUNCTION_ARGS)
PG_RETURN_BOOL
(
true
);
}
#ifdef NOT_USED
/* Disabled in 8.0 due to reliability concerns; FIXME someday */
Datum
pg_terminate_backend
(
PG_FUNCTION_ARGS
)
{
PG_RETURN_INT32
(
pg_signal_backend
(
PG_GETARG_INT32
(
0
),
SIGTERM
));
}
#endif
/* Function to find out which databases make use of a tablespace */
typedef
struct
...
...
src/include/catalog/pg_proc.h
浏览文件 @
c4fd93b3
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.49
1 2008/04/15 20:28:46
momjian Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.49
2 2008/04/17 20:56:41
momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
...
...
@@ -3157,6 +3157,8 @@ DESCR("is schema another session's temp schema?");
DATA
(
insert
OID
=
2171
(
pg_cancel_backend
PGNSP
PGUID
12
1
0
f
f
t
f
v
1
16
"23"
_null_
_null_
_null_
pg_cancel_backend
-
_null_
_null_
));
DESCR
(
"cancel a server process' current query"
);
DATA
(
insert
OID
=
2096
(
pg_terminate_backend
PGNSP
PGUID
12
1
0
f
f
t
f
v
1
16
"23"
_null_
_null_
_null_
pg_terminate_backend
-
_null_
_null_
));
DESCR
(
"terminate a server process"
);
DATA
(
insert
OID
=
2172
(
pg_start_backup
PGNSP
PGUID
12
1
0
f
f
t
f
v
1
25
"25"
_null_
_null_
_null_
pg_start_backup
-
_null_
_null_
));
DESCR
(
"prepare for taking an online backup"
);
DATA
(
insert
OID
=
2173
(
pg_stop_backup
PGNSP
PGUID
12
1
0
f
f
t
f
v
0
25
""
_null_
_null_
_null_
pg_stop_backup
-
_null_
_null_
));
...
...
src/include/utils/builtins.h
浏览文件 @
c4fd93b3
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.31
4 2008/04/15 20:28:47
momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.31
5 2008/04/17 20:56:41
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -416,6 +416,7 @@ extern Datum nonnullvalue(PG_FUNCTION_ARGS);
extern
Datum
current_database
(
PG_FUNCTION_ARGS
);
extern
Datum
current_query
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_cancel_backend
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_terminate_backend
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_reload_conf
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_tablespace_databases
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_rotate_logfile
(
PG_FUNCTION_ARGS
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录