Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6fa79755
Commit
6fa79755
authored
May 30, 2011
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pg_basebackup -z option for compression with default level
parent
cb0defe5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
doc/src/sgml/ref/pg_basebackup.sgml
doc/src/sgml/ref/pg_basebackup.sgml
+18
-4
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_basebackup.c
+10
-1
No files found.
doc/src/sgml/ref/pg_basebackup.sgml
View file @
6fa79755
...
@@ -168,13 +168,27 @@ PostgreSQL documentation
...
@@ -168,13 +168,27 @@ PostgreSQL documentation
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term><option>-z</option></term>
<term><option>--gzip</option></term>
<listitem>
<para>
Enables gzip compression of tar file output, with the default
compression level. Compression is only available when using
the tar format.
</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term><option>-Z <replaceable class="parameter">level</replaceable></option></term>
<term><option>-Z <replaceable class="parameter">level</replaceable></option></term>
<term><option>--compress=<replaceable class="parameter">level</replaceable></option></term>
<term><option>--compress=<replaceable class="parameter">level</replaceable></option></term>
<listitem>
<listitem>
<para>
<para>
Enables gzip compression of tar file output. Compression is only
Enables gzip compression of tar file output, and specifies the
available when using the tar format.
compression level (1 through 9, 9 being best
compression). Compression is only available when using the tar
format.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -393,11 +407,11 @@ PostgreSQL documentation
...
@@ -393,11 +407,11 @@ PostgreSQL documentation
</para>
</para>
<para>
<para>
To create a backup of the local server with one
maximum
compressed
To create a backup of the local server with one compressed
tar file for each tablespace, and store it in the directory
tar file for each tablespace, and store it in the directory
<filename>backup</filename>, showing a progress report while running:
<filename>backup</filename>, showing a progress report while running:
<screen>
<screen>
<prompt>$</prompt> <userinput>pg_basebackup -D backup -Ft -
Z9
-P</userinput>
<prompt>$</prompt> <userinput>pg_basebackup -D backup -Ft -
z
-P</userinput>
</screen>
</screen>
</para>
</para>
...
...
src/bin/pg_basebackup/pg_basebackup.c
View file @
6fa79755
...
@@ -126,7 +126,8 @@ usage(void)
...
@@ -126,7 +126,8 @@ usage(void)
printf
(
_
(
" -D, --pgdata=DIRECTORY receive base backup into directory
\n
"
));
printf
(
_
(
" -D, --pgdata=DIRECTORY receive base backup into directory
\n
"
));
printf
(
_
(
" -F, --format=p|t output format (plain, tar)
\n
"
));
printf
(
_
(
" -F, --format=p|t output format (plain, tar)
\n
"
));
printf
(
_
(
" -x, --xlog include required WAL files in backup
\n
"
));
printf
(
_
(
" -x, --xlog include required WAL files in backup
\n
"
));
printf
(
_
(
" -Z, --compress=0-9 compress tar output
\n
"
));
printf
(
_
(
" -z, --gzip compress tar output
\n
"
));
printf
(
_
(
" -Z, --compress=0-9 compress tar output with given compression level
\n
"
));
printf
(
_
(
"
\n
General options:
\n
"
));
printf
(
_
(
"
\n
General options:
\n
"
));
printf
(
_
(
" -c, --checkpoint=fast|spread
\n
"
printf
(
_
(
" -c, --checkpoint=fast|spread
\n
"
" set fast or spread checkpointing
\n
"
));
" set fast or spread checkpointing
\n
"
));
...
@@ -941,6 +942,7 @@ main(int argc, char **argv)
...
@@ -941,6 +942,7 @@ main(int argc, char **argv)
{
"format"
,
required_argument
,
NULL
,
'F'
},
{
"format"
,
required_argument
,
NULL
,
'F'
},
{
"checkpoint"
,
required_argument
,
NULL
,
'c'
},
{
"checkpoint"
,
required_argument
,
NULL
,
'c'
},
{
"xlog"
,
no_argument
,
NULL
,
'x'
},
{
"xlog"
,
no_argument
,
NULL
,
'x'
},
{
"gzip"
,
no_argument
,
NULL
,
'z'
},
{
"compress"
,
required_argument
,
NULL
,
'Z'
},
{
"compress"
,
required_argument
,
NULL
,
'Z'
},
{
"label"
,
required_argument
,
NULL
,
'l'
},
{
"label"
,
required_argument
,
NULL
,
'l'
},
{
"host"
,
required_argument
,
NULL
,
'h'
},
{
"host"
,
required_argument
,
NULL
,
'h'
},
...
@@ -1000,6 +1002,13 @@ main(int argc, char **argv)
...
@@ -1000,6 +1002,13 @@ main(int argc, char **argv)
case
'l'
:
case
'l'
:
label
=
xstrdup
(
optarg
);
label
=
xstrdup
(
optarg
);
break
;
break
;
case
'z'
:
#ifdef HAVE_LIBZ
compresslevel
=
Z_DEFAULT_COMPRESSION
;
#else
compresslevel
=
1
;
/* will be rejected below */
#endif
break
;
case
'Z'
:
case
'Z'
:
compresslevel
=
atoi
(
optarg
);
compresslevel
=
atoi
(
optarg
);
if
(
compresslevel
<=
0
||
compresslevel
>
9
)
if
(
compresslevel
<=
0
||
compresslevel
>
9
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment