Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKvkm-0008SK-0B for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2023 06:28:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKvkk-0007qJ-TP for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2023 06:28:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKvkk-0007q9-HW for pgsql-hackers@lists.postgresql.org; Thu, 26 Jan 2023 06:28:54 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pKvkh-0006CT-CV for pgsql-hackers@lists.postgresql.org; Thu, 26 Jan 2023 06:28:53 +0000 Received: by mail-il1-x131.google.com with SMTP id i17so440809ila.9 for ; Wed, 25 Jan 2023 22:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=QwiVQE4zmxZnJtmo60sCsVodllNOPO4kZiitCklCi6o=; b=fGuQYHP/S2jnCMvjGoPDxBXj5dsKBnk9eGzL4bakb0XKc96lctb5gvlAyECRSaT7lm n+2Bl8NqwFX0yphGCCb31vvwqJe9+8xGZFC2LQkiOuh2K0tPHgP/gDvkS8GgzNASLaRy se9nMrVIv3uQY8UkK3+WMuq0WEh/Cq2KNxaKaf4zib4zcNYBgTzfoeeIPDLbrMjj5Af4 qN9NgOGQn59DlGTMLmocoMB+K9jQURGlueqb6TiQimda8RV+8Kgk7GPynAT0OA8etsVM Lu2eYmGx7qEGmg+Q6//nF8HUAouhDe1zOR7GHCmeR+KnHaUw9e7k8mJW9k5MMIETbJbY NTmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QwiVQE4zmxZnJtmo60sCsVodllNOPO4kZiitCklCi6o=; b=ywXfVuHe4PsrCGtSQ2HgpSgfikM83U9LaiyjOJ/HNhKeI+PqkTa5j8MxB8K4iYSo6C NF4UKp3/NUwOAHCd1J5CzE8hFcLIDEA5hfV5t4SWrpl+XZLdbBEVRQyfumnpF6isHUVV Rq+PASWaLa9vFRWWlhGaJRPkiJv2Y0KFVm3JNAEOZFsdilY+2CUCpuJtqXnUHiFXh8Q1 RPIiXOULX4vp+NltMMsWzjV8J5gVeLQPyByJWQle32C6gya3lmzzwuAOIMMieXYDkW0E ruc8lNGS20/J8mptPNlzoXCL/tNgBYYC7jqL2hdmOMtpGXGYhamcdoyJuWa2rzrzahQo ehmg== X-Gm-Message-State: AO0yUKVyUHZiSm3F4a+b9eOLq5tmVgrXMomb8lTiHfPBXNZzxICOAjjn 00HscJiOeLk1/IYb0qeCVnwfJw== X-Google-Smtp-Source: AK7set8cYYdTviPze85KqPSpmwilXb0NRMNrMUwTgJcfSU3S63Uwjg8rn7m7f9q4aOyRIWK5SurJ/w== X-Received: by 2002:a05:6e02:1d8c:b0:310:b629:22c with SMTP id h12-20020a056e021d8c00b00310b629022cmr859574ila.12.1674714529126; Wed, 25 Jan 2023 22:28:49 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t16-20020a92cc50000000b0030d6f952221sm124572ilq.75.2023.01.25.22.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 22:28:48 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id B1C7B800CA9; Thu, 26 Jan 2023 00:28:46 -0600 (CST) Date: Thu, 26 Jan 2023 00:28:46 -0600 From: Justin Pryzby To: Michael Paquier Cc: gkokolatos@pm.me, Tomas Vondra , pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: <20230126062846.GO22427@telsasoft.com> References: <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> <20230123180014.GX13860@telsasoft.com> <20230125014203.GL13860@telsasoft.com> <-myGeDiZ-ePDRyi18026Iu2HTTfmwfjWaJn4OWJ2F3oglZUfJTOQ7FARPW7gYxE4vK3b0HpwYoiHR45nfOWReRvvJZfCBfJzPP5iJyn4muk=@pm.me> <20230125180020.GF22427@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 26, 2023 at 02:49:27PM +0900, Michael Paquier wrote: > On Wed, Jan 25, 2023 at 12:00:20PM -0600, Justin Pryzby wrote: > > While looking at this, I realized that commit 5e73a6048 introduced a > > regression: > > > > @@ -3740,19 +3762,24 @@ ReadHead(ArchiveHandle *AH) > > > > - if (AH->compression != 0) > > - pg_log_warning("archive is compressed, but this installation does not support compression -- no data will be available"); > > + if (AH->compression_spec.algorithm == PG_COMPRESSION_GZIP) > > + pg_fatal("archive is compressed, but this installation does not support compression"); > > > > Before, it was possible to restore non-data chunks of a dump file, even > > if the current build didn't support its compression. But that's now > > impossible - and it makes the code we're discussing in RestoreArchive() > > unreachable. > > Right. The impacts the possibility of looking at the header data, > which is useful with pg_restore -l for example. It's not just header data - it's schema and (I think) everything other than table data. > > The coverage report disagrees with me, though... > > https://coverage.postgresql.org/src/bin/pg_dump/pg_backup_archiver.c.gcov.html#3901 > > Isn't that one of the tests like compression_gzip_plain? I'm not sure what you mean. Plain dump is restored with psql and not with pg_restore. My line number was wrong: https://coverage.postgresql.org/src/bin/pg_dump/pg_backup_archiver.c.gcov.html#390 What test would hit that code without rebuilding ? 394 : #ifndef HAVE_LIBZ 395 : if (AH->compression_spec.algorithm == PG_COMPRESSION_GZIP && > Thoughts? > #ifndef HAVE_LIBZ > if (AH->compression_spec.algorithm == PG_COMPRESSION_GZIP) > - pg_fatal("archive is compressed, but this installation does not support compression"); > + pg_log_warning("archive is compressed, but this installation does not support compression -- no data will be available"); Your patch is fine for now, but these errors should eventually specify *which* compression algorithm is unavailable. I think that should be a part of the 001 patch, ideally in a way that minimizes the number of places which need to be updated when adding an algorithm. -- Justin