postgresql/src/tools
Michael Paquier 5e73a60488 Switch pg_dump to use compression specifications
Compression specifications are currently used by pg_basebackup and
pg_receivewal, and are able to let the user control in an extended way
the method and level of compression used.  As an effect of this commit,
pg_dump's -Z/--compress is now able to use more than just an integer, as
of the grammar "method[:detail]".

The method can be either "none" or "gzip", and can optionally take a
detail string.  If the detail string is only an integer, it defines the
compression level.  A comma-separated list of keywords can also be used
method allows for more options, the only keyword supported now is
"level".

The change is backward-compatible, hence specifying only an integer
leads to no compression for a level of 0 and gzip compression when the
level is greater than 0.

Most of the code changes are straight-forward, as pg_dump was relying on
an integer tracking the compression level to check for gzip or no
compression.  These are changed to use a compression specification and
the algorithm stored in it.

As of this change, note that the dump format is not bumped because there
is no need yet to track the compression algorithm in the TOC entries.
Hence, we still rely on the compression level to make the difference
when reading them.  This will be mandatory once a new compression method
is added, though.

In order to keep the code simpler when parsing the compression
specification, the code is changed so as pg_dump now fails hard when
using gzip on -Z/--compress without its support compiled, rather than
enforcing no compression without the user knowing about it except
through a warning.  Like before this commit, archive and custom formats
are compressed by default when the code is compiled with gzip, and left
uncompressed without gzip.

Author: Georgios Kokolatos
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/O4mutIrCES8ZhlXJiMvzsivT7ztAMja2lkdL1LJx6O5f22I2W8PBIeLKz7mDLwxHoibcnRAYJXm1pH4tyUNC4a8eDzLn22a6Pb1S74Niexg=@pm.me
2022-12-02 10:45:02 +09:00
..
ci ci: Add task testing windows with mingw 2022-11-17 16:22:25 -08:00
editors
ifaddrs Remove configure probe for sockaddr_in6 and require AF_INET6. 2022-08-26 10:18:30 +12:00
msvc Fix binary mismatch for MSVC plperl vs gcc built perl libs 2022-11-27 09:03:22 -05:00
perlcheck doc: update metacpan.org links to avoid redirects 2022-11-16 10:24:37 +01:00
pginclude Fix `trap` in a few shell scripts 2022-09-20 18:50:16 +02:00
pgindent Switch pg_dump to use compression specifications 2022-12-02 10:45:02 +09:00
PerfectHash.pm Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
RELEASE_CHANGES Add defenses against unexpected changes in the NodeTag enum list. 2022-07-12 11:22:52 -04:00
ccsym
check_bison_recursion.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
codelines
copyright.pl Avoid re-writing files unnecessarily in src/tools/copyright.pl. 2022-04-11 11:20:20 -04:00
darwin_sysroot Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
find_badmacros
find_meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
find_static Fix `trap` in a few shell scripts 2022-09-20 18:50:16 +02:00
find_typedef
fix-old-flex-code.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
gen_export.pl meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
gen_keywordlist.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
git-external-diff
git_changelog Stamp HEAD as 16devel. 2022-06-30 11:26:40 -04:00
make_ctags Enhance make_ctags and make_etags. 2022-10-19 12:59:29 +09:00
make_etags Enhance make_ctags and make_etags. 2022-10-19 12:59:29 +09:00
make_mkid
mark_pgdllimport.pl Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
pgflex meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pgtest Fix `trap` in a few shell scripts 2022-09-20 18:50:16 +02:00
rcgen meson: Add windows resource files 2022-10-05 09:56:05 -07:00
testint128.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
testwrap meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
valgrind.supp Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
version_stamp.pl Add meson.build to version_stamp.pl 2022-10-12 07:06:10 +02:00
win32tzlist.pl Update copyright for 2022 2022-01-07 19:04:57 -05:00