Skip to content

Commit 6bc83e0

Browse files
amulsulCommitfest Bot
authored andcommitted
pg_waldump: Add support for archived WAL decoding.
pg_waldump can now accept the path to a tar archive containing WAL files and decode them. This feature was added primarily for pg_verifybackup, which previously disabled WAL parsing for tar-formatted backups. Note that this patch requires that the WAL files within the archive be in sequential order; an error will be reported otherwise. The next patch is planned to remove this restriction.
1 parent 7c150b6 commit 6bc83e0

File tree

8 files changed

+799
-78
lines changed

8 files changed

+799
-78
lines changed

doc/src/sgml/ref/pg_waldump.sgml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,17 @@ PostgreSQL documentation
141141
<term><option>--path=<replaceable>path</replaceable></option></term>
142142
<listitem>
143143
<para>
144-
Specifies a directory to search for WAL segment files or a
145-
directory with a <literal>pg_wal</literal> subdirectory that
144+
Specifies a tar archive or a directory to search for WAL segment files
145+
or a directory with a <literal>pg_wal</literal> subdirectory that
146146
contains such files. The default is to search in the current
147147
directory, the <literal>pg_wal</literal> subdirectory of the
148148
current directory, and the <literal>pg_wal</literal> subdirectory
149149
of <envar>PGDATA</envar>.
150150
</para>
151+
<para>
152+
If a tar archive is provided, its WAL segment files must be in
153+
sequential order; otherwise, an error will be reported.
154+
</para>
151155
</listitem>
152156
</varlistentry>
153157

src/bin/pg_waldump/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
PGFILEDESC = "pg_waldump - decode and display WAL"
44
PGAPPICON=win32
55

6+
# make these available to TAP test scripts
7+
export TAR
8+
69
subdir = src/bin/pg_waldump
710
top_builddir = ../../..
811
include $(top_builddir)/src/Makefile.global
@@ -12,11 +15,13 @@ OBJS = \
1215
$(WIN32RES) \
1316
compat.o \
1417
pg_waldump.o \
18+
astreamer_waldump.o \
1519
rmgrdesc.o \
1620
xlogreader.o \
1721
xlogstats.o
1822

19-
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
23+
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
24+
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils
2025

2126
RMGRDESCSOURCES = $(sort $(notdir $(wildcard $(top_srcdir)/src/backend/access/rmgrdesc/*desc*.c)))
2227
RMGRDESCOBJS = $(patsubst %.c,%.o,$(RMGRDESCSOURCES))

0 commit comments

Comments
 (0)