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 1pc2VJ-0007lM-Mv for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Mar 2023 11:07:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pc2VI-00073i-KM for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Mar 2023 11:07:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pc2VI-00073Z-98 for pgsql-hackers@lists.postgresql.org; Tue, 14 Mar 2023 11:07:40 +0000 Received: from mail-4316.protonmail.ch ([185.70.43.16]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pc2VF-0008Ex-8H for pgsql-hackers@lists.postgresql.org; Tue, 14 Mar 2023 11:07:39 +0000 Date: Tue, 14 Mar 2023 11:07:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1678792054; x=1679051254; bh=ASthrTLdZPTbgdBlhq/atE88I8qsaSz5Gs3Um7OP3Vw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=QHcymr4XGhDchQ+F/YBlvD7cQIXsmW8QhDDl5iB6j+oMmeTMqdjFVSezXFNTYnNNH 04AEuXh4JFS8MHNX6BqOV41b3pehqK4YbhTnN+ToKxn12IKMDx5Cgqfu3aBaWv8JOl LveYX2LTDv7i+nF3btGjUMSKamZYKZVq9fWT55RNLtqkIS+8WWmFAyoKTe3ymaXgYw YIR6T3zbkN6zdDCgYukyZzJHmg7QqAWj+a8gk+umWxzRLjFIQugZ8FZ4xPSM90DeJx Ai8voKQJBcrulbhdHyBDtdEAfGLxpEVJVWxqKjOoiXY7ng45eDcSRn4+f3V8FYOUCx tKHfVKFR0ukVQ== To: Tomas Vondra From: gkokolatos@pm.me Cc: Justin Pryzby , shiy.fnst@fujitsu.com, Michael Paquier , pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: In-Reply-To: References: <22cb80ed-ec87-54c7-fd5b-cdcf79766bb1@enterprisedb.com> <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <20230228235834.GC30529@telsasoft.com> Feedback-ID: 6383013:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- Original Message ------- On Monday, March 13th, 2023 at 10:47 PM, Tomas Vondra wrote: >=20 > > Change pg_fatal() to an assertion+comment; >=20 >=20 > Yeah, that's reasonable. I'd even ditch the assert/comment, TBH. We > could add such protections against "impossible" stuff to a zillion other > places and the confusion likely outweighs the benefits. >=20 A minor note to add is to not ignore the lessons learned from a7885c9bb. For example, as the testing framework stands, one can not test that the contents of the custom format are indeed compressed. One can infer it by examining the header of the produced dump and searching for the compression flag. The code responsible for writing the header and the code responsible for actually dealing with data, is not the same. Also, the compression library itself will happily read and write uncompressed data. A pg_fatal, assertion, or similar, is the only guard rail against this kind of error. Without it, the tests will continue passing even after e.g. a wrong initialization of the API. It was such a case that lead to a7885c9bb in the first place. I do think that we wish it to be an "impossible" case. Also it will be an untested case with some history without such a guard rail. Of course I will not object to removing it, if you think that is more confusing than useful. Cheers, //Georgios >=20 > regards >=20 > -- > Tomas Vondra > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company