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 1lNNWD-00007a-0A for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Mar 2021 22:22:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lNNWA-0006jf-LE for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Mar 2021 22:22: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 1lNNWA-0006jY-EK for pgsql-hackers@lists.postgresql.org; Fri, 19 Mar 2021 22:22:54 +0000 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNNW7-0000Vq-7s for pgsql-hackers@lists.postgresql.org; Fri, 19 Mar 2021 22:22:53 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 1A37E1030; Fri, 19 Mar 2021 18:22:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 18:22:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2m5IAGl7AsciZIAAcMKO8PBMPlhH1sBYk8Vkzw5/BJI=; b=quDokLfN ouTg50UF5yFS9ecNvk3bD1gQgyZBHP4ivj8Ll6TeYlZpvlD7b0/R/ceuCAL0DOYC I5My1XfPqXryheTNYBRzcr2g5hrCE1uTYiCjNXeT/D9G4WAkpcmrXa7y6Sp0oiRC hEMis7YPrS15lV0ZG7SAWA6+fsF7RK6P3EN08LarfzlBxYzV3kHrQZqRlm9ZgRRi EIPSotFTGk81V2DVUoRXjcJ2arzgD/pfBn/K+pld9rLUV9AbrObNfX8F1iAS5Dg5 dT48UNqS6tZQH4HKQXrQfdzQvKsNNduCD2vjBw8KGzV7SmxidWS3kls7L+QmDtwX HwaaJvYmps+KsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefledgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id E3CAA240054; Fri, 19 Mar 2021 18:22:44 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 7BAD62A0CAD; Fri, 19 Mar 2021 19:22:42 -0300 (-03) Date: Fri, 19 Mar 2021 19:22:42 -0300 From: Alvaro Herrera To: Robert Haas Cc: Tom Lane , Dilip Kumar , Andres Freund , Justin Pryzby , Tomas Vondra , Alexander Korotkov , David Steele , Ildus Kurbangaliev , Dmitry Dolgov <9erthalion6@gmail.com>, PostgreSQL Hackers Subject: Re: [HACKERS] Custom compression methods Message-ID: <20210319222242.GA23930@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Mar-19, Robert Haas wrote: > > Regarding your point, that does look like clutter. We don't annotate > > the dump with a storage clause unless it's non-default, so probably we > > should do the same thing here. I think I gave Dilip bad advice here... > > Here's a patch for that. It's a little strange because you're going to > skip dumping the toast compression based on the default value on the > source system, but that might not be the default on the system where > the dump is being restored, so you could fail to recreate the state > you had. That is avoidable if you understand how things work, but some > people might not. I don't have a better idea, though, so let me know > what you think of this. Do you mean the column storage strategy, attstorage? I don't think that's really related, because the difference there is not a GUC setting but a compiled-in default for the type. In the case of compression, I'm not sure it makes sense to do it like that, but I can see the clutter argument: if we dump compression for all columns, it's going to be super noisy. (At least, for binary upgrade surely you must make sure to apply the correct setting regardless of defaults on either system). Maybe it makes sense to dump the compression clause if it is different from pglz, regardless of the default on the source server. Then, if the target server has chosen lz4 as default, *all* columns are going to end up as lz4, and if it hasn't, then only the ones that were lz4 in the source server are going to. That seems reasonable behavior. Also, if some columns are lz4 in source, and target does not have lz4, then everything is going to work out to not-lz4 with just a bunch of errors in the output. -- Álvaro Herrera 39°49'30"S 73°17'W