Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit66ec2db

Browse files
committed
XLOG file archiving and point-in-time recovery. There are still some
loose ends and a glaring lack of documentation, but it basically works.Simon Riggs with some editorialization by Tom Lane.
1 parentd0c1bbd commit66ec2db

File tree

13 files changed

+1628
-72
lines changed

13 files changed

+1628
-72
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@
5656
* Portions Copyright (c) 1994, Regents of the University of California
5757
*
5858
* IDENTIFICATION
59-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.83 2004/07/11 18:01:45 tgl Exp $
59+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.84 2004/07/19 02:47:03 tgl Exp $
6060
*
6161
*-------------------------------------------------------------------------
6262
*/
6363

6464
#include"postgres.h"
6565

6666
#include"access/nbtree.h"
67+
#include"access/xlog.h"
6768
#include"miscadmin.h"
6869
#include"storage/smgr.h"
6970
#include"utils/tuplesort.h"
@@ -222,15 +223,9 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2)
222223
/*
223224
* We need to log index creation in WAL iff WAL archiving is enabled
224225
* AND it's not a temp index.
225-
*
226-
* XXX when WAL archiving is actually supported, this test will likely
227-
* need to change; and the hardwired extern is cruddy anyway ...
228226
*/
229-
{
230-
externcharXLOG_archive_dir[];
227+
wstate.btws_use_wal=XLogArchivingActive()&& !wstate.index->rd_istemp;
231228

232-
wstate.btws_use_wal=XLOG_archive_dir[0]&& !wstate.index->rd_istemp;
233-
}
234229
/* reserve the metapage */
235230
wstate.btws_pages_alloced=BTREE_METAPAGE+1;
236231
wstate.btws_pages_written=0;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# -------------------------------
2+
# PostgreSQL recovery config file
3+
# -------------------------------
4+
#
5+
# Edit this file to provide the parameters that PostgreSQL
6+
# needs to perform an archive recovery of a database
7+
#
8+
# If "recovery.conf" is present in the PostgreSQL data directory, it is
9+
# read on postmaster startup. After successful recovery, it is renamed
10+
# to "recovery.done" to ensure that we do not accidentally re-enter archive
11+
# recovery mode.
12+
#
13+
# This file consists of lines of the form:
14+
#
15+
# name = 'value'
16+
#
17+
# (The quotes around the value are NOT optional, but the "=" is.)
18+
#
19+
# Comments are introduced with '#'.
20+
#
21+
# The complete list of option names and
22+
# allowed values can be found in the PostgreSQL documentation. The
23+
# commented-out settings shown below are sample values.
24+
#
25+
#---------------------------------------------------------------------------
26+
# REQUIRED PARAMETERS
27+
#---------------------------------------------------------------------------
28+
#
29+
# restore command
30+
#
31+
# specifies the shell command that is executed to copy log files
32+
# back from archival storage. The command string may contain %f,
33+
# which is replaced by the name of the desired log file, and %p,
34+
# which is replaced by the absolute path to copy the log file to.
35+
#
36+
# It is important that the command return nonzero exit status on failure.
37+
# The command *will* be asked for log files that are not present in the
38+
# archive; it must return nonzero when so asked.
39+
#
40+
# NOTE that the basename of %p will be different from %f; do not
41+
# expect them to be interchangeable.
42+
#
43+
#
44+
#restore_command = 'cp /mnt/server/archivedir/%f %p'
45+
#
46+
#
47+
#---------------------------------------------------------------------------
48+
# OPTIONAL PARAMETERS
49+
#---------------------------------------------------------------------------
50+
#
51+
# By default, recovery will rollforward to the end of the WAL log.
52+
# If you want to stop rollforward before that point, you
53+
# MUST set a recovery target.
54+
#
55+
# You may set a recovery target either by transactionId, or
56+
# by timestamp. Recovery may either include or exclude the
57+
# records with the recovery target value (ie, stop either just
58+
# after or just before the given target).
59+
#
60+
#recovery_target_time = '2004-07-14 22:39:00'
61+
#
62+
# note: target time is interpreted by strptime() and must therefore be
63+
# given in your system's default timezone.
64+
#
65+
#recovery_target_xid = '11000'
66+
#
67+
# true or false
68+
#recovery_target_inclusive = 'true'
69+
#
70+
#---------------------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp