Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
9c7a765f
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,发现更多精彩内容 >>
提交
9c7a765f
编写于
7月 19, 2004
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unportable use of strptime() to parse recovery target time spec.
Instead use our own abstimein code, which is more flexible anyway.
上级
66ec2db7
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
22 addition
and
34 deletion
+22
-34
src/backend/access/transam/recovery.conf.sample
src/backend/access/transam/recovery.conf.sample
+13
-17
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+9
-17
未找到文件。
src/backend/access/transam/recovery.conf.sample
浏览文件 @
9c7a765f
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
# -------------------------------
# -------------------------------
#
#
# Edit this file to provide the parameters that PostgreSQL
# Edit this file to provide the parameters that PostgreSQL
# needs to perform an archive recovery of a database
# needs to perform an archive recovery of a database
.
#
#
# If "recovery.conf" is present in the PostgreSQL data directory, it is
# If "recovery.conf" is present in the PostgreSQL data directory, it is
# read on postmaster startup. After successful recovery, it is renamed
# read on postmaster startup. After successful recovery, it is renamed
# to "recovery.done" to ensure that we do not accidentally re-enter
archive
# to "recovery.done" to ensure that we do not accidentally re-enter
# recovery mode.
#
archive
recovery mode.
#
#
# This file consists of lines of the form:
# This file consists of lines of the form:
#
#
...
@@ -18,15 +18,15 @@
...
@@ -18,15 +18,15 @@
#
#
# Comments are introduced with '#'.
# Comments are introduced with '#'.
#
#
# The complete list of option names and
# The complete list of option names and
allowed values can be found
#
allowed values can be found in the PostgreSQL documentation. The
#
in the PostgreSQL documentation. The commented-out settings shown below
#
commented-out settings shown below are s
ample values.
#
are ex
ample values.
#
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# REQUIRED PARAMETERS
# REQUIRED PARAMETERS
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
#
#
# restore
command
# restore
_
command
#
#
# specifies the shell command that is executed to copy log files
# specifies the shell command that is executed to copy log files
# back from archival storage. The command string may contain %f,
# back from archival storage. The command string may contain %f,
...
@@ -50,21 +50,17 @@
...
@@ -50,21 +50,17 @@
#
#
# By default, recovery will rollforward to the end of the WAL log.
# By default, recovery will rollforward to the end of the WAL log.
# If you want to stop rollforward before that point, you
# If you want to stop rollforward before that point, you
#
MUST
set a recovery target.
#
must
set a recovery target.
#
#
# You may set a recovery target either by transactionId, or
# You may set a recovery target either by transactionId, or
# by timestamp. Recovery may either include or exclude the
# by timestamp. Recovery may either include or exclude the
#
records with the recovery target value (ie, stop either just
#
transaction(s) with the recovery target value (ie, stop either
#
after or just before the given target
).
#
just after or just before the given target, respectively
).
#
#
#recovery_target_time = '2004-07-14 22:39:00'
#recovery_target_time = '2004-07-14 22:39:00
EST
'
#
#
# note: target time is interpreted by strptime() and must therefore be
#recovery_target_xid = '1100842'
# given in your system's default timezone.
#
#
#recovery_target_xid = '11000'
#recovery_target_inclusive = 'true' # 'true' or 'false'
#
# true or false
#recovery_target_inclusive = 'true'
#
#
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
src/backend/access/transam/xlog.c
浏览文件 @
9c7a765f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.14
8 2004/07/19 02:47:05
tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.14
9 2004/07/19 14:34:39
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3196,8 +3196,6 @@ readRecoveryCommandFile(void)
...
@@ -3196,8 +3196,6 @@ readRecoveryCommandFile(void)
recoveryTargetExact
=
true
;
recoveryTargetExact
=
true
;
}
}
else
if
(
strcmp
(
tok1
,
"recovery_target_time"
)
==
0
)
{
else
if
(
strcmp
(
tok1
,
"recovery_target_time"
)
==
0
)
{
struct
tm
tm
;
/*
/*
* if recovery_target_xid specified, then this overrides
* if recovery_target_xid specified, then this overrides
* recovery_target_time
* recovery_target_time
...
@@ -3207,23 +3205,17 @@ readRecoveryCommandFile(void)
...
@@ -3207,23 +3205,17 @@ readRecoveryCommandFile(void)
recoveryTarget
=
true
;
recoveryTarget
=
true
;
recoveryTargetExact
=
false
;
recoveryTargetExact
=
false
;
/*
/*
* convert the time string given
* Convert the time string given by the user to the time_t format.
* by the user to the time_t format.
* We use type abstime's input converter because we know abstime
* has the same representation as time_t.
*/
*/
if
(
strptime
(
tok2
,
"%Y-%m-%d %H:%M:%S"
,
&
tm
)
==
NULL
)
recoveryTargetTime
=
(
time_t
)
ereport
(
FATAL
,
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
abstimein
,
(
errmsg
(
"invalid recovery_target_time
\"
%s
\"
"
,
CStringGetDatum
(
tok2
)));
tok2
),
errhint
(
"Correct format is YYYY-MM-DD hh:mm:ss."
)));
recoveryTargetTime
=
mktime
(
&
tm
);
if
(
recoveryTargetTime
==
(
time_t
)
-
1
)
ereport
(
FATAL
,
(
errmsg
(
"invalid recovery_target_time
\"
%s
\"
"
,
tok2
),
errhint
(
"Correct format is YYYY-MM-DD hh:mm:ss."
)));
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"recovery_target_time = %s"
,
(
errmsg
(
"recovery_target_time = %s"
,
tok2
)));
DatumGetCString
(
DirectFunctionCall1
(
abstimeout
,
AbsoluteTimeGetDatum
((
AbsoluteTime
)
recoveryTargetTime
))))));
}
}
else
if
(
strcmp
(
tok1
,
"recovery_target_inclusive"
)
==
0
)
{
else
if
(
strcmp
(
tok1
,
"recovery_target_inclusive"
)
==
0
)
{
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录