Обсуждение: pgsql: Move tar detection and compression logic to common.
Move tar detection and compression logic to common. Consolidate tar archive identification and compression-type detection logic into a shared location. Currently used by pg_basebackup and pg_verifybackup, this functionality is also required for upcoming pg_waldump enhancements. This change promotes code reuse and simplifies maintenance across frontend tools. Author: Amul Sul <sulamul@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Euler Taveira <euler@eulerto.com> Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com> discussion: https://postgr.es/m/CAAJ_b94bqdWN3h2J-PzzzQ2Npbwct5ZQHggn_QoYGhC2rn-=WQ@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c8a350a439826267186c187dbfbf1f839f7521aa Modified Files -------------- src/bin/pg_basebackup/pg_basebackup.c | 36 ++++++++++--------------------- src/bin/pg_verifybackup/pg_verifybackup.c | 12 +---------- src/common/compression.c | 30 ++++++++++++++++++++++++++ src/include/common/compression.h | 2 ++ 4 files changed, 44 insertions(+), 36 deletions(-)