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 1kkuYT-0000zq-Q8 for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Dec 2020 19:46:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkuYS-0000HT-Nq for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Dec 2020 19:46:16 +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 1kkuYS-0000HM-G8 for pgsql-hackers@lists.postgresql.org; Thu, 03 Dec 2020 19:46:16 +0000 Received: from forward3-smtp.messagingengine.com ([66.111.4.237]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkuYP-0007f9-Ll for pgsql-hackers@lists.postgresql.org; Thu, 03 Dec 2020 19:46:15 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailforward.nyi.internal (Postfix) with ESMTP id E89331943878; Thu, 3 Dec 2020 14:46:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 03 Dec 2020 14:46:12 -0500 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:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=l4GqAK6dG8dNWS55RC285VVz+koMR1P+bfwasfuBq Ss=; b=NTaFWOhn+gk7yU/H4yxdtyvdcrO+yYOsR9xt+F1gbppQZs6v3uIYpArbN dTTFHj8sYCnCt2aQz0Bt9Zgt0zVK5+Gcm1XVHDf5+oCGS9JlUt2VWERqz14dRUM9 cLcE/mje7VaCxUrIw5g1d644ofXwG5M49NOS8JRUWVO6Owuz1t0Q6VpBt5b/sTfG tRHiqu94xP/7UymTb1Qqy2jMzAePECtpc0FEnFr67EsmSGkGmFbVXxK+QWT/DkNW +zklOZ9ei+oU5W9H57OX/jYB1apa42jGc0X8YdQhe5jeVDA73Lx39onfTU0hAXFO UPhF7T4pDklQscARV9EYp9vTCaJfw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeiiedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefheenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnh htvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepffdvueeftdfggfev ffdvheejkeejkeehvddvueehgefhffelvdfgffffffefjedunecukfhppeekjedrudejje drjedvrddugedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtg homh X-ME-Proxy: Received: from april.pezone.net (p57b1488e.dip0.t-ipconnect.de [87.177.72.142]) by mail.messagingengine.com (Postfix) with ESMTPA id 8900F24005B; Thu, 3 Dec 2020 14:46:10 -0500 (EST) Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly To: Michael Paquier , Justin Pryzby References: <20200909122200.GA2743@paquier.xyz> <20200909153629.GG18552@telsasoft.com> <20201031183611.GA22691@telsasoft.com> <20201124153123.GO24052@telsasoft.com> <20201201054308.GC24052@telsasoft.com> Cc: Alexey Kondratov , Alvaro Herrera , Masahiko Sawada , Steve Singer , pgsql-hackers@lists.postgresql.org, Robert Haas , Alexander Korotkov , Masahiko Sawada , Jose Luis Tallon From: Peter Eisentraut Organization: EnterpriseDB Message-ID: <14dde730-1d34-260e-fa9d-7664df2d6313@enterprisedb.com> Date: Thu, 3 Dec 2020 20:46:09 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk A side comment on this patch: I think using enums as bit mask values is bad style. So changing this: -/* Reindex options */ -#define REINDEXOPT_VERBOSE (1 << 0) /* print progress info */ -#define REINDEXOPT_REPORT_PROGRESS (1 << 1) /* report pgstat progress */ -#define REINDEXOPT_MISSING_OK (1 << 2) /* skip missing relations */ -#define REINDEXOPT_CONCURRENTLY (1 << 3) /* concurrent mode */ to this: +typedef enum ReindexOption +{ + REINDEXOPT_VERBOSE = 1 << 0, /* print progress info */ + REINDEXOPT_REPORT_PROGRESS = 1 << 1, /* report pgstat progress */ + REINDEXOPT_MISSING_OK = 1 << 2, /* skip missing relations */ + REINDEXOPT_CONCURRENTLY = 1 << 3 /* concurrent mode */ +} ReindexOption; seems wrong. There are a couple of more places like this, including the existing ClusterOption that this patched moved around, but we should be removing those. My reasoning is that if you look at an enum value of this type, either say in a switch statement or a debugger, the enum value might not be any of the defined symbols. So that way you lose all the type checking that an enum might give you. Let's just keep the #define's like it is done in almost all other places.