Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfv4E-0037q1-Vi for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Mar 2024 05:04:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rfv4D-00BAQI-52 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Mar 2024 05:04:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfv4C-00BAQ9-L6 for pgsql-hackers@lists.postgresql.org; Fri, 01 Mar 2024 05:04:17 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfv4A-002CWW-Fi for pgsql-hackers@postgresql.org; Fri, 01 Mar 2024 05:04:16 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id F17971380088; Fri, 1 Mar 2024 00:04:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 01 Mar 2024 00:04:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1709269452; x=1709355852; bh=fYjT2JkcA2 7K38mGv1AUnJ7tG4pfOD6cH2DvhUvbQeM=; b=k6WbIEYt3LuRfM6sbieJvf3C/U atPzxwy+FIqE+pGfzLzNhZT47q1Wum07gP3A2420MXLNV6122Lha3Ck9O1Y/UUl3 zF5DMg/biqeZXSpN4WCnIDip7FUwf2jNf/iaEbLvGFLWbq9hJ8I7cfBN3nzTekRM XQhrNudOlzFJhCyHHHqM2OI7zB01dwXGGeFIzXCPnK+hZgN5t/oYdUWREl3nAyLL FSVEV+u0+GJL6lQSYpLHXJJGMeC4xTCcF+d0NjxdbTWF2c2CkJGuS8/cmTO5vcrQ 393d/ioDT+rfDcpyGq6s9MUt+veibgMDu8+Za8pGJUjqssRKtjZiOo6KOvog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709269452; x=1709355852; bh=fYjT2JkcA27K38mGv1AUnJ7tG4pf OD6cH2DvhUvbQeM=; b=Mgi6wkdmv6OPqCQEmNLlbvsGDaAgp8SZIUYN4JCqdhFD jnCBbBJJr1Jb/ofpn1bBXLYICQrdd2uAY6gf69vZ1FAkOm7VWxJsWvntpoPdRbeW XaAXCuMZyHv2DT7AHbYo2bQx3SR+qhrmcXvbB3V13phVG+dCTMAeZOR3qIu92rNj ALjkBf4RfAkb9RHBwmQ46SYMDuFlhBZRr/uBvghp3cwFLZBEwTRG+L8VWRs7ktIy aiuOrbvtzEMuCMGMHkyl4RrEUU5NLYkFooOM/vlOpAeqbc/M9hQM52LPcwSnbKBl KsPH8s0Izb+fcBt5vakT9g/aJOq+cHZph3XEU7H47w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrhedtgdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Mar 2024 00:04:08 -0500 (EST) Date: Fri, 1 Mar 2024 14:03:48 +0900 From: Michael Paquier To: Jelte Fennema-Nio Cc: Justin Pryzby , Peter Eisentraut , Soumyadeep Chakraborty , Zhihong Yu , pgsql-hackers@postgresql.org, Ashwin Agrawal , vanjared@vmware.com Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AjVHwQNah/tQKWz2" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --AjVHwQNah/tQKWz2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 01, 2024 at 05:43:25AM +0100, Jelte Fennema-Nio wrote: > I think we should set the AM OID explicitly. Because an important > thing to consider is: What behaviour makes sense when later > default_table_access_method is changed? Per the latest discussion of the thread, we've kind of reached a consensus that we should keep the current historical bevahior on default, where relam remains at 0, causing new partitions to grab the GUC as AM. If we create a partitioned table attached to a partitioned table, it should be 0 as well. If the partitioned table has a non-0 relam, a new partitioned table created on it will inherit the same non-0 value.=20 > I think if someone sets it explicitly on the partitioned table, they > would want the AM of the partitioned table to stay the same when > default_table_access_method is changed. Which requires storing the AM > OID afaict. If we allow relam to be non-0 for a partitioned table, it is equally important to give users a way to reset it at will. My point was a bit more subtle than that. For example, this sequence is clear to me: SET default_table_access_method =3D 'foo'; ALTER TABLE part SET ACCESS METHOD DEFAULT; The user wants to rely on the GUC, so relam should be 0, new partitions created on it will use the GUC. Now, what should this sequence mean? See: SET default_table_access_method =3D 'foo'; ALTER TABLE part SET ACCESS METHOD foo; Should the relam be 0 because the user requested a match with the GUC, or use the OID of the AM? There has to be some difference with tablespaces, because relations with physical storage (tables, matviews) can use a reltablespace of 0, but AMs have to be set for tables and matviews. Fun topic, especially once coupled with the internals of tablecmds.c that uses InvalidOid for the new access AM as a special value to work as a no-op. -- Michael --AjVHwQNah/tQKWz2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXhYbQACgkQnvQgOdby QH1sOg//SJpbOyf2tVHHAah38ZcLK4ql+MIXQsIwls6GGFUOAtl5SnMg1L7IdcJ5 v1vHDqrbK7lLKD/aLHQiy56HR0wrlyLuxLsmyZzWUcigDa9aoeB0e3cAJSuKRLJV 6y8W+Cx0vAMH9N6SLPX5vF/rzFAVo/8jnIXmO2ix1ETwBNl+/AQYTPGL/mwOc4r+ /itu63wdZpYD3578oRoUxQuYoc6UwcDtvu+b3CI6e/1F/rJ51fB2XEytd2slJwrR DfI+RZhgQ8lyWSqbOexu5RseBeYs0zOsEfahsDNdaif83Pb2rJp667HeTENu97AO y6udxREsUAPhd/35H6nWg+bH+NWiU/4KuHmXpM2dSKciB/H/uu/RrTpHt4cBUzhN 4K8eTDhfOqh5BTh1a7r1/XWCfXxVfLrW9z27Cottle3F3dCeVtFrGSzF/ooy+QlQ b14AFaBe0UST+ixhJkwlOoax/It7eInLx50YD2caCIGpy5vCQ7KNiglfCD1X1lDp RTdfUA5nenjSuaBFGhsudyzss+3y75SlqqQaaqIKdzCo+1AgCuC1wfcB51J3ykPo M6WcUFODVSQEx5kGwFvTqXCqpw2y/ij0ZTr1+3g0rEog/03akOZ981INx7a3ptRq 2HelY3PFdRGwW7dGDqfimSMcN4GUBWRFXYih1lrVvrC95upS82g= =omhW -----END PGP SIGNATURE----- --AjVHwQNah/tQKWz2--