1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

Supporting PostgreSQL 9.2.

Fix a bug about --recovery-target-time.
Fix SPEC files for using normal user. (Reported by Nagayasu-san)
Fix a compiling bug on no LZLib environment.
Add restriction about Incremental backup.


git-svn-id: http://pg-rman.googlecode.com/svn/trunk@71 182aca00-e38e-11de-a668-6fd11605f5ce
This commit is contained in:
otsuka.knj@gmail.com 2013-01-24 06:49:34 +00:00
parent 98b6bac4b9
commit 068280f4a3
12 changed files with 80 additions and 17 deletions

View File

@ -9,7 +9,7 @@
## Set general information for pg_rman.
Summary: Backup and Recovery Tool for PostgreSQL
Name: pg_rman
Version: 1.2.4
Version: 1.2.5
Release: 1%{?dist}
License: BSD
Group: Applications/Databases
@ -44,7 +44,7 @@ USE_PGXS=1 make %{?_smp_mflags}
%install
rm -rf %{buildroot}
USE_PGXS=1 make %{?_smp_mflags} install
USE_PGXS=1 DESTDIR=%{buildroot} make %{?_smp_mflags} install
install -d %{buildroot}%{_bindir}
install -m 755 pg_rman %{buildroot}%{_bindir}/pg_rman

View File

@ -9,7 +9,7 @@
## Set general information for pg_rman.
Summary: Backup and Recovery Tool for PostgreSQL
Name: pg_rman
Version: 1.2.4
Version: 1.2.5
Release: 1%{?dist}
License: BSD
Group: Applications/Databases
@ -44,7 +44,7 @@ USE_PGXS=1 make %{?_smp_mflags}
%install
rm -rf %{buildroot}
USE_PGXS=1 make %{?_smp_mflags} install
USE_PGXS=1 DESTDIR=%{buildroot} make %{?_smp_mflags} install
install -d %{buildroot}%{_bindir}
install -m 755 pg_rman %{buildroot}%{_bindir}/pg_rman

64
SPECS/pg_rman92.spec Normal file
View File

@ -0,0 +1,64 @@
# SPEC file for pg_rman
# Copyright(C) 2009-2012 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
%define _pgdir /usr/pgsql-9.2
%define _bindir %{_pgdir}/bin
%define _libdir %{_pgdir}/lib
%define _datadir %{_pgdir}/share
## Set general information for pg_rman.
Summary: Backup and Recovery Tool for PostgreSQL
Name: pg_rman
Version: 1.2.5
Release: 1%{?dist}
License: BSD
Group: Applications/Databases
Source0: %{name}-%{version}.tar.gz
URL: http://code.google.com/p/pg-rman/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
Vendor: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
## We use postgresql-devel package
BuildRequires: postgresql92-devel
Requires: postgresql92-libs
## Description for "pg_rman"
%description
pg_rman manages backup and recovery of PostgreSQL.
pg_rman has the features below:
-Takes a backup while database including tablespaces with just one command.
-Can recovery from backup with just one command.
-Supports incremental backup and compression of backup files so that it takes less disk spaces.
-Manages backup generations and shows a catalog of the backups.
## pre work for build pg_rman
%prep
%setup -q -n %{name}-%{version}
## Set variables for build environment
%build
USE_PGXS=1 make %{?_smp_mflags}
## Set variables for install
%install
rm -rf %{buildroot}
USE_PGXS=1 DESTDIR=%{buildroot} make %{?_smp_mflags} install
install -d %{buildroot}%{_bindir}
install -m 755 pg_rman %{buildroot}%{_bindir}/pg_rman
%clean
rm -rf %{buildroot}
%files
%defattr(755,root,root)
%{_bindir}/pg_rman
# History of pg_rman.
%changelog
* Wed Nov 10 2010 - NTT OSS Center <tomonari.katsumata@oss.ntt.co.jp> 1.2.0-1
* Wed Dec 9 2009 - NTT OSS Center <itagaki.takahiro@oss.ntt.co.jp> 1.1.1-1
- Initial cut for 1.1.1

View File

@ -684,10 +684,10 @@ do_backup(bool smooth_checkpoint,
elog(ERROR_ARGS, _("required parameter not specified: SRVLOG_PATH (-S, --srvlog-path)"));
#ifndef HAVE_LIBZ
if (current->compress_data)
if (current.compress_data)
{
elog(WARNING, _("requested compression not available in this: installation -- archive will be uncompressed"));
current->compress_data = false;
current.compress_data = false;
}
#endif

2
data.c
View File

@ -294,7 +294,6 @@ backup_data_file(const char *from_root, const char *to_root,
z_stream z;
char outbuf[zlibOutSize];
#endif
INIT_CRC32(crc);
/* reset size summary */
@ -787,7 +786,6 @@ copy_file(const char *from_root, const char *to_root, pgFile *file,
char outbuf[zlibOutSize];
char inbuf[zlibInSize];
#endif
INIT_CRC32(crc);
/* reset size summary */

View File

@ -15,13 +15,13 @@ diff files in BACKUP_PATH/backup/pg_xlog
1
diff files in BACKUP_PATH/backup/pg_xlog
# of files in BACKUP_PATH/backup/srvlog
1
2
full database backup after recovery
CHECKPOINT
# of files in BACKUP_PATH/backup/pg_xlog
0
# of files in BACKUP_PATH/backup/srvlog
1
2
# of symbolic links in ARCLOG_PATH
0
# of files in BACKUP_PATH/timeline_history

View File

@ -54,7 +54,7 @@ Generic options:
Read the website for details. <http://code.google.com/p/pg-rman/>
Report bugs to <http://code.google.com/p/pg-rman/issues/list>.
pg_rman 1.2.4
pg_rman 1.2.5
ERROR: required parameter not specified: BACKUP_PATH (-B, --backup-path)
ERROR: required parameter not specified: BACKUP_MODE (-b, --backup-mode)
ERROR: required parameter not specified: ARCLOG_PATH (-A, --arclog-path)

View File

@ -14,7 +14,7 @@
#include <time.h>
#include <sys/stat.h>
const char *PROGRAM_VERSION = "1.2.4";
const char *PROGRAM_VERSION = "1.2.5";
const char *PROGRAM_URL = "http://code.google.com/p/pg-rman/";
const char *PROGRAM_EMAIL = "http://code.google.com/p/pg-rman/issues/list";

View File

@ -163,7 +163,7 @@ do_restore(const char *target_time,
if (base_backup->compress_data &&
(HAVE_DATABASE(base_backup) || HAVE_ARCLOG(base_backup)))
{
elog(EXIT_NOT_SUPPORTED,
elog(ERROR_SYSTEM,
_("can't restore from compressed backup (compression not supported in this installation)"));
}
#endif
@ -201,7 +201,7 @@ base_backup_found:
continue;
/* is the backup is necessary for restore to target timeline ? */
if (!satisfy_timeline(timelines, backup) && !satisfy_recovery_target(backup, rt))
if (!satisfy_timeline(timelines, backup) || !satisfy_recovery_target(backup, rt))
continue;
if (verbose)

View File

@ -1,3 +0,0 @@
\! pg_rman backup --verbose
\! pg_rman backup -B data/sample_backup --verbose

View File

@ -78,6 +78,7 @@ logging_collector = on
wal_level = archive
archive_mode = on
archive_command = 'cp "%p" "$ARCLOG_PATH/%f"'
log_filename = 'postgresql-%F_%H%M%S.log'
EOF
mkdir -p $ARCLOG_PATH

3
xlog.c
View File

@ -28,6 +28,7 @@ typedef struct MemoryContextData *MemoryContext;
#define XLOG_PAGE_MAGIC_v84 0xD063 /* 8.4 */
#define XLOG_PAGE_MAGIC_v90 0xD064 /* 9.0 */
#define XLOG_PAGE_MAGIC_v91 0xD066 /* 9.1 */
#define XLOG_PAGE_MAGIC_v92 0xD071 /* 9.2 */
/*
* XLogLongPageHeaderData is modified in 8.3, but the layout is compatible
@ -78,6 +79,8 @@ xlog_is_complete_wal(const pgFile *file, int server_version)
xlog_page_magic = XLOG_PAGE_MAGIC_v90;
else if (server_version < 90200)
xlog_page_magic = XLOG_PAGE_MAGIC_v91;
else if (server_version < 90300)
xlog_page_magic = XLOG_PAGE_MAGIC_v92;
else
return false; /* not supported */