Skip to content

Commit 9abe67f

Browse files
committed
Merge branch 'PGPRO9_5' of gitlab.postgrespro.ru:pgpro-dev/postgrespro into PGPRO9_5
2 parents db955ba + 10e893a commit 9abe67f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+9515
-33
lines changed

contrib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ SUBDIRS = \
3434
oid2name \
3535
pageinspect \
3636
passwordcheck \
37+
pg_arman \
3738
pg_buffercache \
3839
pg_freespacemap \
3940
pg_prewarm \

contrib/pg_arman/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Object files
2+
*.o
3+
4+
# Libraries
5+
*.lib
6+
*.a
7+
8+
# Shared objects (inc. Windows DLLs)
9+
*.dll
10+
*.so
11+
*.so.*
12+
*.dylib
13+
14+
# Executables
15+
*.exe
16+
*.app
17+
18+
# Dependencies
19+
.deps
20+
21+
# Binaries
22+
/pg_arman
23+
24+
# Generated by test suite
25+
/regression.diffs
26+
/regression.out
27+
/results
28+
29+
# Extra files
30+
/datapagemap.c
31+
/datapagemap.h
32+
/xlogreader.c

contrib/pg_arman/COPYRIGHT

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2009-2013, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
2+
3+
Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
4+
Portions Copyright (c) 1994, The Regents of the University of California
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
* Neither the name of the NIPPON TELEGRAPH AND TELEPHONE CORPORATION
15+
(NTT) nor the names of its contributors may be used to endorse or
16+
promote products derived from this software without specific prior
17+
written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

contrib/pg_arman/Makefile

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
PROGRAM = pg_arman
2+
OBJS = backup.o \
3+
catalog.o \
4+
data.o \
5+
delete.o \
6+
dir.o \
7+
fetch.o \
8+
init.o \
9+
parray.o \
10+
pg_arman.o \
11+
restore.o \
12+
show.o \
13+
status.o \
14+
util.o \
15+
validate.o \
16+
datapagemap.o \
17+
parsexlog.o \
18+
xlogreader.o \
19+
pgut/pgut.o \
20+
pgut/pgut-port.o
21+
22+
DOCS = doc/pg_arman.txt
23+
24+
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c
25+
26+
REGRESS = init option show delete backup restore
27+
28+
# asciidoc and xmlto are present, so install the html documentation and man
29+
# pages as well. html is part of the vanilla documentation. Man pages need a
30+
# special handling at installation.
31+
ifneq ($(ASCIIDOC),)
32+
ifneq ($(XMLTO),)
33+
man_DOCS = doc/pg_arman.1
34+
DOCS += doc/pg_arman.html doc/README.html
35+
endif # XMLTO
36+
endif # ASCIIDOC
37+
38+
all: docs datapagemap.h pg_arman
39+
ifdef $(USE_PGXS)
40+
PG_CONFIG = pg_config
41+
PGXS := $(shell $(PG_CONFIG) --pgxs)
42+
include $(PGXS)
43+
44+
.PHONY: checksrcdir
45+
checksrcdir:
46+
ifndef top_srcdir
47+
@echo "You must have PostgreSQL source tree available to compile."
48+
@echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
49+
@echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
50+
@exit 1
51+
endif
52+
else
53+
subdir=contrib/pg_arman
54+
top_builddir=../..
55+
include $(top_builddir)/src/Makefile.global
56+
include $(top_srcdir)/contrib/contrib-global.mk
57+
endif
58+
PG_CPPFLAGS = -I$(libpq_srcdir)
59+
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
60+
PG_LIBS = $(libpq_pgport)
61+
62+
63+
64+
envtest:
65+
: top_srcdir=$(top_srcdir)
66+
: libpq_srcdir = $(libpq_srcdir)
67+
# This rule's only purpose is to give the user instructions on how to pass
68+
# the path to PostgreSQL source tree to the makefile.
69+
70+
# Those files are symlinked from the PostgreSQL sources.
71+
xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/%
72+
rm -f $@ && $(LN_S) $< .
73+
datapagemap.c: % : $(top_srcdir)/src/bin/pg_rewind/%
74+
rm -f $@ && $(LN_S) $< .
75+
datapagemap.h: % : $(top_srcdir)/src/bin/pg_rewind/%
76+
rm -f && $(LN_S) $< .
77+
78+
# Part related to documentation
79+
# Compile documentation as well is ASCIIDOC and XMLTO are defined
80+
ifneq ($(ASCIIDOC),)
81+
ifneq ($(XMLTO),)
82+
docs:
83+
$(MAKE) -C doc/
84+
85+
# Special handling for man pages, they need to be in a dedicated folder
86+
install: install-man
87+
88+
install-man:
89+
$(MKDIR_P) '$(DESTDIR)$(mandir)/man1/'
90+
$(INSTALL_DATA) $(man_DOCS) '$(DESTDIR)$(mandir)/man1/'
91+
else
92+
docs:
93+
@echo "No docs to build"
94+
endif # XMLTO
95+
else
96+
docs:
97+
@echo "No docs to build"
98+
endif # ASCIIDOC
99+
100+
# Clean up documentation as well
101+
clean: clean-docs
102+
clean-docs:
103+
$(MAKE) -C doc/ clean
104+
105+
# Disable make check
106+
check:
107+
true

contrib/pg_arman/README

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
pg_arman
2+
========
3+
4+
pg_arman is a backup and recovery manager for PostgreSQL servers able to do
5+
differential and full backup as well as restore a cluster to a
6+
state defined by a given recovery target. It is designed to perform
7+
periodic backups of an existing PostgreSQL server, combined with WAL
8+
archives to provide a way to recover a server in case of failure of
9+
server because of a reason or another. Its differential backup
10+
facility reduces the amount of data necessary to be taken between
11+
two consecutive backups.
12+
13+
Download
14+
--------
15+
16+
The latest version of this software can be found on the project website at
17+
https://github.com/michaelpq/pg_arman.
18+
19+
Installation
20+
------------
21+
22+
Compiling pg_arman requires a PostgreSQL installation to be in place
23+
as well as a raw source tree. Pass the path to the PostgreSQL source tree
24+
to make, in the top_srcdir variable:
25+
26+
make USE_PGXS=1 top_srcdir=<path to PostgreSQL source tree>
27+
28+
In addition, you must have pg_config in $PATH.
29+
30+
The current version of pg_arman is compatible with PostgreSQL 9.5 and
31+
upper versions.
32+
33+
Platforms
34+
---------
35+
36+
pg_arman has been tested on Linux and Unix-based platforms.
37+
38+
Documentation
39+
-------------
40+
41+
All the documentation is maintained in doc/ as text file, that is then
42+
fetched by asciidoc to generate automatically man pages and html
43+
documentation.
44+
45+
In order to generate the documentation, the variables XMLTO and ASCIIDOC
46+
need to be set to proper values indicating where are located the binaries
47+
of respectively xmlto and asciidoc. An example of build is as follows:
48+
49+
make top_srcdir=<path to PostgreSQL source tree> \
50+
ASCIIDOC=asciidoc XMLTO=xmlto
51+
52+
They could as well be set as environment variables for development
53+
purposes.
54+
55+
On OSX, it is necessary to set XML_CATALOG_FILES to point to the correct
56+
xml catalogs. In the case of an environment with Homebrew after having
57+
install xmlto and asciidoc:
58+
59+
export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"
60+
61+
Regression tests
62+
----------------
63+
64+
The test suite of pg_arman is available in the code tree and can be
65+
launched in a way similar to common PostgreSQL extensions and modules:
66+
67+
make installcheck
68+
69+
License
70+
-------
71+
72+
pg_arman can be distributed under the PostgreSQL license. See COPYRIGHT
73+
file for more information. pg_arman is a fork of the existing project
74+
pg_rman, initially created and maintained by NTT and Itagaki Takahiro.

0 commit comments

Comments
 (0)