postgresql/src/common
Michael Paquier d18655cc03 Refactor code parsing compression option values (-Z/--compress)
This commit moves the code in charge of deparsing the method and detail
strings fed later to parse_compress_specification() to a common routine,
where the backward-compatible case of only an integer being found (N
= 0 => "none", N > 1 => gzip at level N) is handled.

Note that this has a side-effect for pg_basebackup, as we now attempt to
detect "server-" and "client-" before checking for the integer-only
pre-14 grammar, where values like server-N and client-N (without the
follow-up detail string) are now valid rather than failing because of an
unsupported method name.  Past grammars are still handled the same way,
but these flavors are now authorized, and would now switch to consider N
= 0 as no compression and N > 1 as gzip with the compression level used
as N, with the caller still controlling if the compression method should
be done server-side, client-side or is unspecified.  The documentation
of pg_basebackup is updated to reflect that.

This benefits other code paths that would like to rely on the same logic
as pg_basebackup and pg_receivewal with option values used for
compression specifications, one area discussed lately being pg_dump.

Author: Georgios Kokolatos, Michael Paquier
Discussion: https://postgr.es/m/O4mutIrCES8ZhlXJiMvzsivT7ztAMja2lkdL1LJx6O5f22I2W8PBIeLKz7mDLwxHoibcnRAYJXm1pH4tyUNC4a8eDzLn22a6Pb1S74Niexg=@pm.me
2022-11-30 09:34:32 +09:00
..
unicode meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
.gitignore Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
Makefile Rename backup_compression.{c,h} to compression.{c,h} 2022-04-12 13:38:54 +09:00
archive.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
base64.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
checksum_helper.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
compression.c Refactor code parsing compression option values (-Z/--compress) 2022-11-30 09:34:32 +09:00
config_info.c Assorted examples of expanded type-safer palloc/pg_malloc API 2022-09-12 08:45:03 +02:00
controldata_utils.c Remove AssertArg and AssertState 2022-10-28 09:19:06 +02:00
cryptohash.c Fix comment related to pg_cryptohash_error() 2022-01-12 12:39:36 +09:00
cryptohash_openssl.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
d2s.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
d2s_full_table.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
d2s_intrinsics.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
digit_table.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
encnames.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
exec.c Clean up inconsistent use of fflush(). 2022-08-29 13:55:41 -04:00
f2s.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
fe_memutils.c Remove redundant null pointer checks before free() 2022-07-03 11:47:15 +02:00
file_perm.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
file_utils.c Introduce pg_pwrite_zeros() in fileutils.c 2022-11-08 12:23:46 +09:00
hashfn.c Use bitwise rotate functions in more places 2022-02-20 13:22:08 +07:00
hmac.c Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
hmac_openssl.c Clear the OpenSSL error queue before cryptohash operations 2022-05-06 14:41:31 +02:00
ip.c Don't bother to set sockaddr_un.sun_len. 2022-08-24 00:09:37 +12:00
jsonapi.c Change some errdetail() to errdetail_internal() 2022-09-28 17:14:53 +02:00
keywords.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
kwlookup.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
link-canary.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
logging.c logging: Also add the command prefix to detail and hint messages 2022-05-30 07:26:06 +02:00
md5.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
md5_common.c Add missing error handling in pg_md5_hash(). 2022-04-18 20:04:55 -04:00
md5_int.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
pg_get_line.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_lzcompress.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_prng.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgfnames.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
protocol_openssl.c Remove AssertArg and AssertState 2022-10-28 09:19:06 +02:00
psprintf.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
relpath.c Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
restricted_token.c Replace load of functions by direct calls for some WIN32 2022-09-09 10:52:17 +09:00
rmtree.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
ryu_common.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
saslprep.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
scram-common.c Improve error handling of HMAC computations 2022-01-13 16:17:21 +09:00
sha1.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
sha1_int.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sha2.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
sha2_int.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sprompt.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
string.c pg_clean_ascii(): escape bytes rather than lose them 2022-09-13 16:10:44 +02:00
stringinfo.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
unicode_norm.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
username.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
wait_error.c Check return value of pclose() correctly 2022-11-15 15:36:51 +01:00
wchar.c Treat Unicode codepoints of category "Format" as non-spacing 2022-09-13 16:13:33 +07:00