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 1lNfWT-0003fu-2h for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Mar 2021 17:36:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lNfWR-0006Ap-Kt for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Mar 2021 17:36:23 +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 1lNfWR-0006Ai-Cw for pgsql-hackers@lists.postgresql.org; Sat, 20 Mar 2021 17:36:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNfWQ-0001Fm-3A for pgsql-hackers@lists.postgresql.org; Sat, 20 Mar 2021 17:36:23 +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 12KHaFBZ229251; Sat, 20 Mar 2021 13:36:16 -0400 From: Tom Lane To: Justin Pryzby cc: Dilip Kumar , Robert Haas , Alvaro Herrera , Andres Freund , Tomas Vondra , Alexander Korotkov , David Steele , Ildus Kurbangaliev , Dmitry Dolgov <9erthalion6@gmail.com>, pgsql-hackers@lists.postgresql.org Subject: Re: [HACKERS] Custom compression methods In-reply-to: <20210320153933.GT11765@telsasoft.com> References: <20210319222242.GA23930@alvherre.pgsql> <4158590.1616185209@sss.pgh.pa.us> <20210320000625.GP11765@telsasoft.com> <20210320074420.GR11765@telsasoft.com> <20210320153933.GT11765@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Sat, 20 Mar 2021 10:39:34 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <229249.1616261775.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 20 Mar 2021 13:36:15 -0400 Message-ID: <229250.1616261775@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Justin Pryzby writes: > On Sat, Mar 20, 2021 at 04:37:53PM +0530, Dilip Kumar wrote: >> - And, 0008 and 0009, I think my >> 0001-Fixup-dump-toast-compression-method.patch[1] is doing this in a >> much simpler way, please have a look and let me know if you think that >> has any problems and we need to do the way you are doing here? > I tested and saw that your patch doesn't output "SET default_toast_compr= ession" > in non-text dumps (pg_dump -Fc). Yeah, _doSetFixedOutputState is the wrong place: that runs on the pg_restore side of the fence, and would not have access to the necessary info in a separated dump/restore run. It might be necessary to explicitly pass the state through in a TOC item, as we do for things like the standard_conforming_strings setting. regards, tom lane