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 1lGY7A-0004Jy-N3 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Mar 2021 02:16:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lGY79-0001s7-LT for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Mar 2021 02:16:51 +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 1lGY78-0001rj-5i for pgsql-hackers@lists.postgresql.org; Mon, 01 Mar 2021 02:16:51 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGY75-00064L-EJ for pgsql-hackers@postgresql.org; Mon, 01 Mar 2021 02:16:49 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id ED4685800CD; Sun, 28 Feb 2021 21:16:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 28 Feb 2021 21:16:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=AtnuimzExgtTMAuK4JDhUlihJcg vEeX/M8kCAJsDBS4=; b=l02B9lQT+nPj+uNfU5cn6/2Z6RioD6tZ7sWWGdXdUPF J4SGsKGhTfTgotLBpiT8BdlQ+oc/NcejttmjCYsL9eBmGu6DOjbmvqeF0uvzN+z1 tndvX6QvuSJBj1185lS/GM4HNBx/N/L7+Qt4NimvTQgscGxT2rJPveZP500NClOm WE//PBuXNcOZGzShPfpzJdhRoH4wRkifx/OTklCATp7cfqcGUvnfxBs6HvhVYPIR dnmHSN8EnNKUNP2uioO2oq+QJs9AeoBKfDOte4zzV7YXIoM7nznBmvCUPz2LwXex zQecgwqhKYe65cRSYA4ry7d70pr7ittBjyK5raIcxMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=Atnuim zExgtTMAuK4JDhUlihJcgvEeX/M8kCAJsDBS4=; b=viTeyqdxSjmp3ZGYgudcsL xK2T60bLHTHG1hOE3dO4VDkZF4liDvDjKerHztwpQf6pp/rHaCEowdbh6nrQkqaG h+q8n70adydUVwvoQ+kjKSKeLxAi6gw4gSalILGfpz327eJ958w7bLV6Na9utI3V vji4lJFZ/KKq23n9sxLYv66sP2NSDN9FHNaDTnN9grmza0rtfMi7CiQamUprUd2K mwreQDojtYtDO3VvrtNLkc0Y7wzFiXH8M4/6I5otvjDU/A8dqbPA0yle469PCFHd znI/yMN+LI0EDKgv6kHKYVkE43VAP1tDJ2RebLz5ifYIaP1wM1FJSiRTJ5ApRHCg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleejgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtdorredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepjeefteelleehjeegveevheefkedv heelvefhjedugffhffdutdejgfelffduvdfhnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquh hivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 0944524005A; Sun, 28 Feb 2021 21:16:40 -0500 (EST) Date: Mon, 1 Mar 2021 11:16:36 +0900 From: Michael Paquier To: Justin Pryzby Cc: pgsql-hackers@postgresql.org, Jacob Champion , Heikki Linnakangas , Ashwin Agrawal , Ashutosh Sharma , Andres Freund , Robert Haas , Amit Kapila , Alvaro Herrera , Dilip Kumar Subject: Re: alter table set TABLE ACCESS METHOD Message-ID: References: <20210228222530.GD20769@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WysfFXOlmD1PcBt8" Content-Disposition: inline In-Reply-To: <20210228222530.GD20769@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --WysfFXOlmD1PcBt8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Feb 28, 2021 at 04:25:30PM -0600, Justin Pryzby wrote: > I called this "set TABLE access method" rather than just "set access method" > for the reasons given on the LIKE thread: > https://www.postgresql.org/message-id/20210119210331.GN8560@telsasoft.com ALTER TABLE applies to a table (or perhaps a sequence, still..), so that sounds a bit weird to me to add again the keyword "TABLE" for that. > I've tested this with zedstore, but the lack of 2nd, in-core table AM limits > testing possibilities. It also limits at least my own ability to reason about > the AM API. > > For example, I was surprised to hear that toast is a concept that's > intended to be applied to AMs other than heap. > https://www.postgresql.org/message-id/flat/CA%2BTgmoYTuT4sRtviMLOOO%2B79VnDCpCNyy9rK6UZFb7KEAVt21w%40mail.gmail.com What kind of advanced testing do you have in mind? It sounds pretty much enough to me for a basic patch to use the trick with heap2 as your patch does. That would be enough to be sure that the rewrite happens and that data is still around. If you are worrying about recovery, a TAP test with an immediate stop of the server could equally be used to check after the FPWs produced for the new relfilenode during the rewrite. -- Michael --WysfFXOlmD1PcBt8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmA8ToQACgkQnvQgOdby QH1a5g/8CfcfhSPn/eRZ/6jFZ24plA9iXepAZQlMGLY024xXxOfWzA/FLWpYd1Q8 /oyzh4ZsED+XXX6deF3f2ImSh+Vs23CTDul4at/0gYlLnb3+6rQcfDar7dBI/6nt KRSrgNvD5zFJdPS5vJqeS/4oaXVTED4WNA3Yhb8I5ATcwFvxm/As9lCJJkIHeL1h eSimExRGl/XdHud4jc6reqW0d5U/zdEipK2IeJ2oB+4ryAqB+XYsf6vk3Assj8wE QHm9v/RzN+mWkuLkpLSaX+KVBJvwTI8JAmf+3XK5Ur7RNd0HlR5Hv8D8ejspUN8e 2mDuy9GhFsiQbsCr39TrhppIytnuyiZnXhcD6emHMVvs0VvAb2nGGS29mbvNNvUF YXJWtxzopbqQLkQDfLFYgycYGhkq7u5wMEBjzyI1uwL3fCXLbvD2aekQsO0mqoWx bTJ8Asgdw3WKKg8Fcr22g+lCfzHYmxKXZhN6elRVR9U5l7+m+MrtxTQcHxxqmkZd IeTJP6TDdVw/jLxFdK9UDjnzZob3bpBTZ4ZxV/kkvG9UD51TyDHlV/0ZXmvlx5Wf mJxxz0y1i9YfVaveH46X020suuKRBAOZp15jnKTPnuSSIpFcXbQ/yVxW1aCAvj+r q/ipHRkMW7O6O3ZGb3dLCHrk7uNZntP8u6bRv4rnAC1QtY3YdUs= =Nx7C -----END PGP SIGNATURE----- --WysfFXOlmD1PcBt8--