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 1mf6ni-0000PF-Qh for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 20:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mf6nh-0003ZK-Lc for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 20:42:33 +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 1mf6ng-0003YG-P4 for pgsql-hackers@lists.postgresql.org; Mon, 25 Oct 2021 20:42:33 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mf6nd-0003es-M7 for pgsql-hackers@postgresql.org; Mon, 25 Oct 2021 20:42:31 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 81AEE5C024D; Mon, 25 Oct 2021 16:42:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Oct 2021 16:42:28 -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= fm1; bh=Vtg5vVRuYabiN8lqjMx2zqmno0tBB1BEdIjxN0W36eI=; b=Xyfjtjzi dGQ9X6dslzgxyFww9SzZ0MHhIOfkKFisClHKhMNTF5YkViMhBZNLEVQ3BRdYCRr1 baTemum5PZ1fVygkWwXgq6JKyPGV7rGSL1TLyxxuAho/lqdnbJBJjC9O++UrVpaF YSXcdsjBJfN6Gj6YVyatNk0pCDrmELpkFh9bE0o2y7Erwij/JwuLizMpvQlyZnEl jVAGXzGN8SwFVnaBGPdbzvF1zxML2ajZPu87+SihBXrSC9HMz9SWYx6pOrJ+WQGN mVbdBuqzRdbIXGbi8xnNNq3wUJpZq+PP26SYqkrWb+mmnihXZLDj02WWEfCIf3H7 aYo6f33SFC2BJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepfeduleekteeigfegledtvddvvddtledugfefhfdtieev teeftdeuueehudeuvdelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh dpphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 16:42:27 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E351C2A083F; Mon, 25 Oct 2021 17:42:23 -0300 (-03) Date: Mon, 25 Oct 2021 17:42:23 -0300 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , Hans Buschmann , "pgsql-hackers@postgresql.org" Subject: Re: Assorted improvements in pg_dump Message-ID: <202110252042.wyr6xsa42atg@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4167039.1635192154@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Oct-25, Tom Lane wrote: > Yeah, I wasn't too happy with the static bools either. However, each > function would need its own field in the struct, which seems like a > maintenance annoyance, plus a big hazard for future copy-and-paste > changes (ie, copy and paste the wrong flag name -> trouble). Also > the Archive struct is shared between dump and restore cases, so > adding a dozen fields that are irrelevant for restore didn't feel > right. So I'd like a better idea, but I'm not sure that that one > is better. What about a separate struct passed from pg_dump's main() to the functions that execute queries, containing a bunch of bools? This'd still have the problem that mindless copy and paste would cause a bug, but I wonder if that isn't overstated: if you use the wrong flag, pg_dump would fail as soon as you try to invoke your query when it hasn't been prepared yet. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "I'm impressed how quickly you are fixing this obscure issue. I came from MS SQL and it would be hard for me to put into words how much of a better job you all are doing on [PostgreSQL]." Steve Midgley, http://archives.postgresql.org/pgsql-sql/2008-08/msg00000.php