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 1pXPBc-0007d5-C4 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 16:20:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXPBb-00025F-6N for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 16:20:11 +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 1pXPBa-000255-Rh for pgsql-hackers@lists.postgresql.org; Wed, 01 Mar 2023 16:20:10 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pXPBY-0003Cv-3k for pgsql-hackers@lists.postgresql.org; Wed, 01 Mar 2023 16:20:10 +0000 Received: by mail-wr1-x42f.google.com with SMTP id r18so13847572wrx.1 for ; Wed, 01 Mar 2023 08:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=irOJ8gdUf0zFX309N5OSZ8Zyux2Rm2wgn8cjB9/LuF8=; b=ZDTKb8Vv0QxP6wprO1GIoYet6SrMBqizrH17uDryvlxXglitshWRyMwTIJprqRF4pV 8i28nrnwRZGmTGueyC8Yp1KfexY7NjHU+Bs9zSX1Jb38n+t7b2Qf+L2uF2hmIEm+eSex dDit7xZTt1A6MZv9PEUkUHoQIj5JmOw6B+PKqKw/L4SwC3QxHjxc3+AcCPJIHb+BtDNN 8hWlIwlwAvKw9T7n4HHiv9aKygVUaSAFZTVRTtK7b9nAoUrrhq/+f/F/M7DpySN1zBOx uAmIsE/od6W5HTjcR7B/yWNi4ZFWIrvMzbAyOGA10VSgaNHvlbAXPKT2WmrsBrKcTq1m qRKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=irOJ8gdUf0zFX309N5OSZ8Zyux2Rm2wgn8cjB9/LuF8=; b=KmpxhfgFfJUdVe25GSzo0cRITTaFyyZVlJhQMM68ILV0Fxu3aTl1uzXseJWE9vTjEb ZFub6UFusbBjmCFCcIibY7fhWrUreDggZXhjebB4F89k1Y4BA6fRvYAO5gbCBASgPO7i MtZ0NgJ+/kVSataxpeH+Hk/8I8v/CveBq7olyQ8X9Z/EM9DxEal+y10hxeJbCQxj6kzx Rep/N0MzWkIpimbORlQ8Wv47Coy3Yzyv9EY4P9ZXTrJzns7p8T3fwK4sQyrDPqoIHjEA B/svcqyjz9zJNWiw70PszfEWI1lo/EP1J1TEfD2X2AsEsXeEov2CbXSCdINKBN9RGlT2 eOJA== X-Gm-Message-State: AO0yUKVE0OTVGf2cupTNB13vqJXIry2rznj+KfoYAUkByUv+R2c+ppdI OjGJeZ07mXe43d102+FvReKyYOnmEnKvaxJM3WyIyTwUekeKVadBhGvf15rJQwtGbtAosomoJs+ ZD4tZa9Vcnh+OLpQeX1r4Elfq5DcPRHISFI9cY1K592mGJATfcZEvSErCQTXdA+UiWDiP5RWV6A XXUvJCI3FfVIsp4HMMn3Q3qWwG4ZVbLwguS0Ly3LhsXkus3HCXhdli X-Google-Smtp-Source: AK7set8D5GVVBx+3hMNvwzGSM4YBvT/T1+mD//ugbeX6EtdKC208lTLjL3D6BA64vJirska2Cr8Y0g== X-Received: by 2002:adf:f847:0:b0:2c7:cbea:1140 with SMTP id d7-20020adff847000000b002c7cbea1140mr5334063wrq.71.1677687606945; Wed, 01 Mar 2023 08:20:06 -0800 (PST) Received: from [10.137.0.17] (static-84-42-175-93.bb.vodafone.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id j4-20020a5d6044000000b002c53f6c7599sm13116623wrt.29.2023.03.01.08.20.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Mar 2023 08:20:06 -0800 (PST) Message-ID: Date: Wed, 1 Mar 2023 17:20:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Add LZ4 compression in pg_dump Content-Language: en-US To: Justin Pryzby , gkokolatos@pm.me Cc: Michael Paquier , shiy.fnst@fujitsu.com, pgsql-hackers@lists.postgresql.org, Rachel Heaton References: <535565cd-b69f-c064-a845-15c0fc44db4a@enterprisedb.com> <22cb80ed-ec87-54c7-fd5b-cdcf79766bb1@enterprisedb.com> <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <20230224015115.GS1653@telsasoft.com> <20230225050214.GH1653@telsasoft.com> <20230225140553.GI1653@telsasoft.com> From: Tomas Vondra In-Reply-To: <20230225140553.GI1653@telsasoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/25/23 15:05, Justin Pryzby wrote: > On Fri, Feb 24, 2023 at 11:02:14PM -0600, Justin Pryzby wrote: >> I have some fixes (attached) and questions while polishing the patch for >> zstd compression. The fixes are small and could be integrated with the >> patch for zstd, but could be applied independently. > > One more - WriteDataToArchiveGzip() says: > > + if (cs->compression_spec.level == 0) > + pg_fatal("requested to compress the archive yet no level was specified"); > > That was added at e9960732a. > > But if you specify gzip:0, the compression level is already enforced by > validate_compress_specification(), before hitting gzip.c: > > | pg_dump: error: invalid compression specification: compression algorithm "gzip" expects a compression level between 1 and 9 (default at -1) > > 5e73a6048 intended that to work as before, and you *can* specify -Z0: > > The change is backward-compatible, hence specifying only an integer > leads to no compression for a level of 0 and gzip compression when the > level is greater than 0. > > $ time ./src/bin/pg_dump/pg_dump -h /tmp regression -t int8_tbl -Fp --compress 0 |file - > /dev/stdin: ASCII text > FWIW I agree we should make this backwards-compatible - accept "0" and treat it as no compression. Georgios, can you prepare a patch doing that? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company