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 1pmisr-0005tl-5M for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 22:24:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmisp-0005FA-Mv for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2023 22:24:07 +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 1pmiso-0005Ez-RF for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 22:24:07 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pmisj-002WUN-EJ for pgsql-hackers@lists.postgresql.org; Wed, 12 Apr 2023 22:24:04 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id ADBDF5C00CE; Wed, 12 Apr 2023 18:23:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 12 Apr 2023 18:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1681338236; x=1681424636; bh=wv NM24WpuK5QL09QtvTOQdSNsjyDod8bDi/FZIeH8ac=; b=FtH9kd3V9jJ/3q29+r pRyWEnArvfCzyPuBiO6bTnoEyAMOjbWId4ETgk1zOi53NYiehBeMqeIM0Tzng70E Op9ddi3R5yyAj73uzIV/Ta97gTIhMBlZfOUcDhxWYX9fbeXiLlS+BvPljHEGAQWC V/+n6QrJ1s9CG72m+y0i730gNWiSyCQJApkRRJFBiH73Ky7Hl3JmKbjGMbfrJ0d1 YKjHPkbpnfzCJOYEj7lTnR8eVQW4OkTg/O/ImTVkP/BFE9bXntVNfUn0YBjZxDoC S2248wLjx9cnY9JtTvnh+dx4YRGnfYq2A9n6z8n9AGORGVlg7Ms5/0cepB26Kzo6 1TdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681338236; x=1681424636; bh=wvNM24WpuK5QL 09QtvTOQdSNsjyDod8bDi/FZIeH8ac=; b=gOPo7j1nF1KMQAF5sitIB7VRtu1mU QXTboVg1f29H8SbOWKlAj2/J4fPjRIzD6uI456U4uBe4SkF/AgM4GvSkA4hLAsOS mjx3LXIHjlHV+V1bEqRWGEJ9mw0+Pw7HHZ1miGR5haYIYdyYyMOMKyMjMIw/BpzS fKiUAU/Q7lOuXiz3SdaQEy19KNIFMZQxPcnfu2zGg5k71iLbZok6kQ+MGWEK8qO2 0e0A9Mmpek+sNK/tP8eGlp36jT26GMPLQ2j5XsTCFMeeA2crmOHj98pjPOHmzbcp xbYrr5ZbPF7WSYCiRhs8ucpT1CuEVlbqzdl2C3PM8CDpxqiUmZnM5PkVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekjedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Apr 2023 18:23:53 -0400 (EDT) Date: Thu, 13 Apr 2023 07:23:48 +0900 From: Michael Paquier To: Justin Pryzby Cc: Tomas Vondra , gkokolatos@pm.me, shiy.fnst@fujitsu.com, pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: References: <8ffd14fe-0278-7f8d-78d4-472816d06268@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UFXkd3FBcCQ8Oqsm" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --UFXkd3FBcCQ8Oqsm Content-Type: multipart/mixed; boundary="/LXAByhyS41ROdHY" Content-Disposition: inline --/LXAByhyS41ROdHY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 11, 2023 at 08:19:59PM -0500, Justin Pryzby wrote: > On Wed, Apr 12, 2023 at 10:07:08AM +0900, Michael Paquier wrote: >> Yes, this comment gives no value as it stands. I would be tempted to >> follow the suggestion to group the whole code block in a single ifdef, >> including the check, and remove this comment. Like the attached >> perhaps? >=20 > +1 Let me try this one again, as the previous patch would cause a warning under --without:-zlib as user_compression_defined would be unused. We could do something like the attached instead. It means doing twice parse_compress_specification() for the non-zlib path, still we are already doing so for the zlib path. If there are other ideas, feel free. -- Michael --/LXAByhyS41ROdHY Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pgdump-comment-2.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 967ced4eed..596f64ed2c 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -751,17 +751,21 @@ main(int argc, char **argv) =20 /* * Custom and directory formats are compressed by default with gzip when - * available, not the others. + * available if no compression specification has been specified, not the + * others. */ - if ((archiveFormat =3D=3D archCustom || archiveFormat =3D=3D archDirector= y) && - !user_compression_defined) + if (!user_compression_defined) { + if (archiveFormat =3D=3D archCustom || archiveFormat =3D=3D archDirector= y) + { #ifdef HAVE_LIBZ - parse_compress_specification(PG_COMPRESSION_GZIP, NULL, - &compression_spec); + parse_compress_specification(PG_COMPRESSION_GZIP, NULL, + &compression_spec); #else - /* Nothing to do in the default case */ + parse_compress_specification(PG_COMPRESSION_NONE, NULL, + &compression_spec); #endif + } } =20 /* --/LXAByhyS41ROdHY-- --UFXkd3FBcCQ8Oqsm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQ3L3QACgkQnvQgOdby QH09Hg/+Ptyv265JCZlnwJLY/pUKlzPPwBTzYo4b8uvgUuDz/HQ9SHsD/Xc2c1yF BPpMFYD63fWP316pv9YeL95f+kqjKaQWg88wTnnrGCAogJMc5Q1HZlVFIa9i0R+z cxsoxZDKyAg8bq3pUahejFuc4JdTaZspO5zVePyJGeA6aQ2RFrY7t2AXulduATrf f7gtSPeZT8eLbrYluWsR/A1d5BqBshC5LfyJthonNOr4LMS1bKvTrznKpzxDHXz7 B/7w7oxcUw+KybiDybKev7MZnY7AGnshAPakHYHlhSreWQuZIfszTvyAmrdHd1xH gdKoPDkju5yHJFv9Mhw3cg80IC0B8Xpar7vKUWXHygMUPtuujgyZ01k6MAB62H8x T78VuB6tdXi0yMVjzuLF9tvz5prIOh+LQ/ypXN/ENmEPF11/aALS/G7EUo9r3r4J NRyYZFyqwLGkOGCb42MTNiTrPsyVjH7TUpc+aItL0hoZLB4IjM9tJIdcTOkBLmdg qhneaNRMQNLw1xsW8VRRC5fG6Rz6WFSJznVIlSS2sxRJgzDQlhsRCdjW1/rtTi/f cR2c9Y4kbAd7DUBmcwJWlIe6iURZYKvZLrgV1ZOn8wcYpQC9ph6Hm2ZYxl0NqmGj 1tfb5B9+E2E4f20y2r3HXnWllv+vElOc2MHdFbCVFzqc6vMmk5g= =OhrO -----END PGP SIGNATURE----- --UFXkd3FBcCQ8Oqsm--