Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
600da67f
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,发现更多精彩内容 >>
提交
600da67f
编写于
5月 04, 2008
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add pg_conf_load_time() function to report when the Postgres configuration
files were last loaded. George Gensure
上级
45173ae2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
54 addition
and
14 deletion
+54
-14
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+24
-4
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+4
-1
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/timestamp.c
+10
-2
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc-file.l
+4
-1
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+2
-2
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+5
-2
src/include/utils/timestamp.h
src/include/utils/timestamp.h
+5
-2
未找到文件。
doc/src/sgml/func.sgml
浏览文件 @
600da67f
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
4 2008/04/28 14:48:57 alvherre
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
5 2008/05/04 21:13:35 tgl
Exp $ -->
<chapter
id=
"functions"
>
<title>
Functions and Operators
</title>
...
...
@@ -10891,6 +10891,12 @@ postgres=# select * from unnest2(array[[1,2],[3,4]]);
<entry>
server start time
</entry>
</row>
<row>
<entry><literal><function>
pg_conf_load_time
</function>
()
</literal></entry>
<entry><type>
timestamp with time zone
</type></entry>
<entry>
configuration load time
</entry>
</row>
<row>
<entry><literal><function>
session_user
</function></literal></entry>
<entry><type>
name
</type></entry>
...
...
@@ -11031,9 +11037,23 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
</indexterm>
<para>
<function>
pg_postmaster_start_time
</function>
returns the
<type>
timestamp with time zone
</type>
when the
server started.
<function>
pg_postmaster_start_time
</function>
returns the
<type>
timestamp with time zone
</type>
when the
server started.
</para>
<indexterm>
<primary>
pg_conf_load_time
</primary>
</indexterm>
<para>
<function>
pg_conf_load_time
</function>
returns the
<type>
timestamp with time zone
</type>
when the
server configuration files were last loaded.
(If the current session was alive at the time, this will be the time
when the session itself re-read the configuration files, so the
reading will vary a little in different sessions. Otherwise it is
the time when the postmaster process re-read the configuration files.)
</para>
<indexterm>
...
...
src/backend/postmaster/postmaster.c
浏览文件 @
600da67f
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.55
6 2008/04/26 22:47:40
tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.55
7 2008/05/04 21:13:35
tgl Exp $
*
* NOTES
*
...
...
@@ -390,6 +390,7 @@ typedef struct
InheritableSocket
pgStatSock
;
pid_t
PostmasterPid
;
TimestampTz
PgStartTime
;
TimestampTz
PgReloadTime
;
bool
redirection_done
;
#ifdef WIN32
HANDLE
PostmasterHandle
;
...
...
@@ -4263,6 +4264,7 @@ save_backend_variables(BackendParameters * param, Port *port,
param
->
PostmasterPid
=
PostmasterPid
;
param
->
PgStartTime
=
PgStartTime
;
param
->
PgReloadTime
=
PgReloadTime
;
param
->
redirection_done
=
redirection_done
;
...
...
@@ -4468,6 +4470,7 @@ restore_backend_variables(BackendParameters * param, Port *port)
PostmasterPid
=
param
->
PostmasterPid
;
PgStartTime
=
param
->
PgStartTime
;
PgReloadTime
=
param
->
PgReloadTime
;
redirection_done
=
param
->
redirection_done
;
...
...
src/backend/utils/adt/timestamp.c
浏览文件 @
600da67f
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.18
7 2008/03/25 22:42:44
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.18
8 2008/05/04 21:13:35
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -42,6 +42,8 @@
/* Set at postmaster start */
TimestampTz
PgStartTime
;
/* Set at configuration reload */
TimestampTz
PgReloadTime
;
static
TimeOffset
time2t
(
const
int
hour
,
const
int
min
,
const
int
sec
,
const
fsec_t
fsec
);
...
...
@@ -1157,11 +1159,17 @@ clock_timestamp(PG_FUNCTION_ARGS)
}
Datum
pg
sql
_postmaster_start_time
(
PG_FUNCTION_ARGS
)
pg_postmaster_start_time
(
PG_FUNCTION_ARGS
)
{
PG_RETURN_TIMESTAMPTZ
(
PgStartTime
);
}
Datum
pg_conf_load_time
(
PG_FUNCTION_ARGS
)
{
PG_RETURN_TIMESTAMPTZ
(
PgReloadTime
);
}
/*
* GetCurrentTimestamp -- get the current operating system time
*
...
...
src/backend/utils/misc/guc-file.l
浏览文件 @
600da67f
...
...
@@ -4,7 +4,7 @@
*
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.5
3 2008/01/01 19:45:54 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.5
4 2008/05/04 21:13:35 tgl
Exp $
*/
%{
...
...
@@ -309,6 +309,9 @@ ProcessConfigFile(GucContext context)
PGC_S_FILE, GUC_ACTION_SET, true);
}
/* Remember when we last successfully loaded the config file. */
PgReloadTime = GetCurrentTimestamp();
cleanup_list:
free_name_value_list(head);
if (cvc)
...
...
src/include/catalog/catversion.h
浏览文件 @
600da67f
...
...
@@ -37,7 +37,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/catversion.h,v 1.45
3 2008/04/29 14:59:17 alvherre
Exp $
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.45
4 2008/05/04 21:13:35 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 20080
4292
#define CATALOG_VERSION_NO 20080
5041
#endif
src/include/catalog/pg_proc.h
浏览文件 @
600da67f
...
...
@@ -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
4 2008/04/29 13:00:22 alvherre
Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.49
5 2008/05/04 21:13:36 tgl
Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
...
...
@@ -3922,8 +3922,11 @@ DATA(insert OID = 2559 ( lastval PGNSP PGUID 12 1 0 f f t f v 0 20 "" _null
DESCR
(
"current value from last used sequence"
);
/* start time function */
DATA
(
insert
OID
=
2560
(
pg_postmaster_start_time
PGNSP
PGUID
12
1
0
f
f
t
f
s
0
1184
""
_null_
_null_
_null_
pgsql
_postmaster_start_time
-
_null_
_null_
));
DATA
(
insert
OID
=
2560
(
pg_postmaster_start_time
PGNSP
PGUID
12
1
0
f
f
t
f
s
0
1184
""
_null_
_null_
_null_
pg
_postmaster_start_time
-
_null_
_null_
));
DESCR
(
"postmaster start time"
);
/* config reload time function */
DATA
(
insert
OID
=
2034
(
pg_conf_load_time
PGNSP
PGUID
12
1
0
f
f
t
f
s
0
1184
""
_null_
_null_
_null_
pg_conf_load_time
-
_null_
_null_
));
DESCR
(
"configuration load time"
);
/* new functions for Y-direction rtree opclasses */
DATA
(
insert
OID
=
2562
(
box_below
PGNSP
PGUID
12
1
0
f
f
t
f
i
2
16
"603 603"
_null_
_null_
_null_
box_below
-
_null_
_null_
));
...
...
src/include/utils/timestamp.h
浏览文件 @
600da67f
...
...
@@ -6,7 +6,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/timestamp.h,v 1.7
6 2008/03/21 01:31:43
tgl Exp $
* $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.7
7 2008/05/04 21:13:36
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -195,6 +195,8 @@ typedef struct
/* Set at postmaster start */
extern
TimestampTz
PgStartTime
;
/* Set at configuration reload */
extern
TimestampTz
PgReloadTime
;
/*
...
...
@@ -303,7 +305,8 @@ extern Datum now(PG_FUNCTION_ARGS);
extern
Datum
statement_timestamp
(
PG_FUNCTION_ARGS
);
extern
Datum
clock_timestamp
(
PG_FUNCTION_ARGS
);
extern
Datum
pgsql_postmaster_start_time
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_postmaster_start_time
(
PG_FUNCTION_ARGS
);
extern
Datum
pg_conf_load_time
(
PG_FUNCTION_ARGS
);
/* Internal routines (not fmgr-callable) */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录