pgsql: Move tar detection and compression logic to common.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move tar detection and compression logic to common.
Date: 2026-03-20 19:32:10
Message-ID: E1w3fZp-000gjX-2n@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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(at)gmail(dot)com>
Reviewed-by: Robert Haas <robertmhaas(at)gmail(dot)com>
Reviewed-by: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Euler Taveira <euler(at)eulerto(dot)com>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-03-20 19:44:54 pgsql: Fix dependency on FDW's connection function.
Previous Message Nathan Bossart 2026-03-20 19:16:30 pgsql: Bump transaction/multixact ID warning limits to 100M.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-03-20 19:33:18 Re: pg_waldump: support decoding of WAL inside tarfile
Previous Message Tomas Vondra 2026-03-20 19:20:34 Re: Add GoAway protocol message for graceful but fast server shutdown/switchover