mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
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.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.83 2004/07/11 18:01:45 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.84 2004/07/19 02:47:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "postgres.h"
|
||||
|
||||
#include "access/nbtree.h"
|
||||
#include "access/xlog.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/smgr.h"
|
||||
#include "utils/tuplesort.h"
|
||||
@@ -222,15 +223,9 @@ _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2)
|
||||
/*
|
||||
* We need to log index creation in WAL iff WAL archiving is enabled
|
||||
* AND it's not a temp index.
|
||||
*
|
||||
* XXX when WAL archiving is actually supported, this test will likely
|
||||
* need to change; and the hardwired extern is cruddy anyway ...
|
||||
*/
|
||||
{
|
||||
extern char XLOG_archive_dir[];
|
||||
wstate.btws_use_wal = XLogArchivingActive() && !wstate.index->rd_istemp;
|
||||
|
||||
wstate.btws_use_wal = XLOG_archive_dir[0] && !wstate.index->rd_istemp;
|
||||
}
|
||||
/* reserve the metapage */
|
||||
wstate.btws_pages_alloced = BTREE_METAPAGE + 1;
|
||||
wstate.btws_pages_written = 0;
|
||||
|
||||
70
src/backend/access/transam/recovery.conf.sample
Normal file
70
src/backend/access/transam/recovery.conf.sample
Normal file
@@ -0,0 +1,70 @@
|
||||
# -------------------------------
|
||||
# PostgreSQL recovery config file
|
||||
# -------------------------------
|
||||
#
|
||||
# Edit this file to provide the parameters that PostgreSQL
|
||||
# needs to perform an archive recovery of a database
|
||||
#
|
||||
# If "recovery.conf" is present in the PostgreSQL data directory, it is
|
||||
# read on postmaster startup. After successful recovery, it is renamed
|
||||
# to "recovery.done" to ensure that we do not accidentally re-enter archive
|
||||
# recovery mode.
|
||||
#
|
||||
# This file consists of lines of the form:
|
||||
#
|
||||
# name = 'value'
|
||||
#
|
||||
# (The quotes around the value are NOT optional, but the "=" is.)
|
||||
#
|
||||
# Comments are introduced with '#'.
|
||||
#
|
||||
# The complete list of option names and
|
||||
# allowed values can be found in the PostgreSQL documentation. The
|
||||
# commented-out settings shown below are sample values.
|
||||
#
|
||||
#---------------------------------------------------------------------------
|
||||
# REQUIRED PARAMETERS
|
||||
#---------------------------------------------------------------------------
|
||||
#
|
||||
# restore command
|
||||
#
|
||||
# specifies the shell command that is executed to copy log files
|
||||
# back from archival storage. The command string may contain %f,
|
||||
# which is replaced by the name of the desired log file, and %p,
|
||||
# which is replaced by the absolute path to copy the log file to.
|
||||
#
|
||||
# It is important that the command return nonzero exit status on failure.
|
||||
# The command *will* be asked for log files that are not present in the
|
||||
# archive; it must return nonzero when so asked.
|
||||
#
|
||||
# NOTE that the basename of %p will be different from %f; do not
|
||||
# expect them to be interchangeable.
|
||||
#
|
||||
#
|
||||
#restore_command = 'cp /mnt/server/archivedir/%f %p'
|
||||
#
|
||||
#
|
||||
#---------------------------------------------------------------------------
|
||||
# OPTIONAL PARAMETERS
|
||||
#---------------------------------------------------------------------------
|
||||
#
|
||||
# By default, recovery will rollforward to the end of the WAL log.
|
||||
# If you want to stop rollforward before that point, you
|
||||
# MUST set a recovery target.
|
||||
#
|
||||
# You may set a recovery target either by transactionId, or
|
||||
# by timestamp. Recovery may either include or exclude the
|
||||
# records with the recovery target value (ie, stop either just
|
||||
# after or just before the given target).
|
||||
#
|
||||
#recovery_target_time = '2004-07-14 22:39:00'
|
||||
#
|
||||
# note: target time is interpreted by strptime() and must therefore be
|
||||
# given in your system's default timezone.
|
||||
#
|
||||
#recovery_target_xid = '11000'
|
||||
#
|
||||
# true or false
|
||||
#recovery_target_inclusive = 'true'
|
||||
#
|
||||
#---------------------------------------------------------------------------
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user