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 1l4lU7-0000Ty-Gb for pgsql-committers@arkaria.postgresql.org; Wed, 27 Jan 2021 14:07:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4lU6-0001j5-EH for pgsql-committers@arkaria.postgresql.org; Wed, 27 Jan 2021 14:07:50 +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 1l4lU5-0001iv-D1 for pgsql-committers@lists.postgresql.org; Wed, 27 Jan 2021 14:07:50 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4lU2-0000rM-Gq for pgsql-committers@lists.postgresql.org; Wed, 27 Jan 2021 14:07:49 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 912E05C019E; Wed, 27 Jan 2021 09:07:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 27 Jan 2021 09:07:44 -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:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=UAW1G800sV6defcjB2R5UYn1Ev8h1bCyhQJTgXSwIrY=; b=Yj2Uip5G +C+RCdG7KDlSUM5f05YBqJT3yprFdZ5PkKDoI3cDow7e+JtfwEHfaIjdoWRIfB6J MSRsbA95JYUMWwxGSGEP/uzeROhpdodkTS8WvNiTSMP05ZrOw/v+YGUmiQBitryl gtf0W3tGvy3iArIINMyJ+kkRHKmI9MvSwGI1uzax+3PJHMctsC8/sbH9Y7v1rcoE SCfyuB7wWWpmnEVApcMjKCwIB+qbHWHcd3XrqSgngNFu0vpa1QUVVt+HdRH82h08 0/tDqzEiy1QLZmOXUCvzu8asBAy6ymCuQK4shFOhSAdFwAPtmp7+Rsw8Yj6KC7I1 rJzaIot8tNX5QA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdekgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueefieei vefgteehueefteehvdenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id DF72C108005F; Wed, 27 Jan 2021 09:07:43 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0B6412A0FAE; Wed, 27 Jan 2021 11:07:41 -0300 (-03) Date: Wed, 27 Jan 2021 11:07:41 -0300 From: Alvaro Herrera To: Michael Paquier Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov Message-ID: <20210127140741.GA14174@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: Precedence: bulk On 2021-Jan-27, Michael Paquier wrote: > Refactor code in tablecmds.c to check and process tablespace moves Thanks, looks good. Small comment: CheckRelationTableSpaceMove is documented as + * Returns true if the relation can be moved to the new tablespace; + * false otherwise. but in reality it returns false if the relation does not *need* to be moved because the tablespace is the same as before. In the cases where it "cannot" be moved, what it does is raise an error. Maybe this needs is just be documented more clearly: "Returns true if the relation can be moved to the new tablespace; raises an error if it is not possible to do the move; returns false if the move would have no effect." For cases of relation with storage, I find it suspicious that the functions are documented to be fine with just ShareUpdateExclusiveLock. I think it'd be safer for the comment to explicitly indicate that for relations with storage, lock should be AEL. -- Álvaro Herrera 39°49'30"S 73°17'W