Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v7zoM-00B6tm-9O for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Oct 2025 17:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v7zoI-001rPf-Ig for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Oct 2025 17:24:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v7zoI-001rOB-7h for pgsql-hackers@lists.postgresql.org; Sun, 12 Oct 2025 17:24:43 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v7zoG-001NXs-1t for pgsql-hackers@lists.postgresql.org; Sun, 12 Oct 2025 17:24:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 59CHObqr025346; Sun, 12 Oct 2025 13:24:37 -0400 From: Tom Lane To: Michael Paquier cc: gkokolatos@pm.me, Justin Pryzby , Rachel Heaton , Greg Stark , pgsql-hackers@lists.postgresql.org Subject: Re: Add LZ4 compression in pg_dump In-reply-to: References: <20220326061441.GH28503@telsasoft.com> Comments: In-reply-to Michael Paquier message dated "Tue, 05 Apr 2022 10:34:49 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25344.1760289877.1@sss.pgh.pa.us> Date: Sun, 12 Oct 2025 13:24:37 -0400 Message-ID: <25345.1760289877@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ blast-from-the-past department ] Michael Paquier writes: > At the end I am finishing with the attached. I also saw an overlap > with the addition of --jobs for the directory format vs not using the > option, so I have removed the case where --jobs was not used in the > directory format. (This patch became commit 98fe74218.) I am wondering if you remember why this bit: + # Give coverage for manually compressed blob.toc files during + # restore. + compress_cmd => { + program => $ENV{'GZIP_PROGRAM'}, + args => [ '-f', "$tempdir/compression_gzip_dir/blobs.toc", ], + }, was set up to manually compress blobs.toc but not the main TOC in the toc.dat file. It turns out that Gzip_read is broken for the case of a zero-length read request [1], but we never reach that case unless toc.dat is compressed. We don't cover the getc_func member of the compression stream API, either. I thought for a bit about proposing that we compress toc.dat but not blobs.toc, but that loses coverage in another way: the gets_func API turns out to be used only while reading blobs.toc. So we need to compress both files manually if we want full coverage. I think this change won't lose coverage, because there are other tests in 002_pg_dump.pl that exercise directory format without extra compression of anything. Thoughts? regards, tom lane [1] https://www.postgresql.org/message-id/3686.1760232320%40sss.pgh.pa.us