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 1rxUSg-0099YZ-4r for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:18:10 +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 1rxUSd-006eKp-5R for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:18:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxUSc-006eKg-0W for pgsql-hackers@lists.postgresql.org; Thu, 18 Apr 2024 16:18:06 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxUSX-003Tfd-4o for pgsql-hackers@postgresql.org; Thu, 18 Apr 2024 16:18:04 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.nyi.internal (Postfix) with ESMTP id E1C8D13800B8; Thu, 18 Apr 2024 12:17:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 18 Apr 2024 12:17:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1713457079; x= 1713543479; bh=bOX8rk6p3Oc94vd96qxWXrFUTZIReTJQdASexcUOHSM=; b=J lr5yIUxf4oLbt1XuHN++g3r9CkO57tsD9TpYNbxgbb1wi1arS2bgliWj9QZqwkqo eEFuDpwxQvgU1hYEfCvqrTLAXRzFPzq9Ds0ADCSDlSK3P7HmktnphqSxgLu7pGzn wM5HnmRkmOW+MyO6BDttd3GMCnuxaA84wMZS9tIheH5M1c+ycP58d3++2iO13U9v C592pC7PlWuU45u9tCWYiQrnS48wWdFzrqCJGLYo5giWCNvADWi47a3DlHSBPxDI pycS5ugpoozS32Rq8HOoVqL/arIoFuYoSMPsyRY+n7StW6UzfktiyYvzYeHKbJv/ 7KS7OtSs4ax8DP09vozaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudektddgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Apr 2024 12:17:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1713457076; bh=BMY/+d7CUx7r1ZejNdG/CuO1r/iPnRkNe0fYrl6PkW0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=KASf0gGuvZeai8pMCoNmg9dS3z5ZbzY3XXS8a/v+1jCkNIreyAJpqr+WmbWnxPcUv 6XH0ryIvhxX/nWOfoSrQSiGedgUyFyjiA1su2eCrJQIai1KS8tIWbVWi8j3YYQSjbg pnF3m8TKUKSwANCxAer8VYeyW7HcUFjMrzXHNGUBjKTbWdgp6g37nMda0TNj9uG74K H7Fg9UWDvgNqXoXJMGLP90/SfJa7Q2jm6vV/uThZ7w7wtEd7TNvI3lPb/L8XvtTuU8 yRwDbwvTUL0jOlphtAnA1LNUJv9Iaws9TDi2rRWCts1I4aEZGOZURpWIMHg3ZNCh48 AtmZqJf+xyYWg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id D7451385; Thu, 18 Apr 2024 18:17:56 +0200 (CEST) Date: Thu, 18 Apr 2024 18:17:56 +0200 From: Alvaro Herrera To: Michael Paquier Cc: Tom Lane , Justin Pryzby , Alexander Lakhin , 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: <202404181617.fkow5ghqjcqs@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Apr-18, Michael Paquier wrote: > On Wed, Apr 17, 2024 at 10:31:52AM +0200, Alvaro Herrera wrote: > > Hmm, maybe we should do a RESET of default_table_access_method before > > printing the CREATE TABLE to avoid the confusion. > > A hard reset would make the business around currTableAM that decides > when to generate the SET default_table_access_method queries slightly > more complicated, while increasing the number of queries run on the > server. Hmm, okay. (I don't think we really care too much about the number of queries, do we?) > Fine by me to use two routines to generate the two different commands. > I am finishing with the attached for now, making dumps, restores and > upgrades work happily as far as I've tested. Great. > I was also worrying about a need to dump the protocol version to be > able to track the relkind in the toc entries, but a45c78e3284b has > already done one. The difference in AM handling between relations > without storage and relations with storage pushes the relkind logic > more within the internals of pg_backup_archiver.c. Hmm, does this mean that every dump taking since a45c78e3284b (April 1st) and before this commit will be unrestorable? This doesn't worry me too much, because we aren't even in beta yet ... and I think we don't have a strict policy about it. > --- a/src/bin/pg_dump/t/002_pg_dump.pl > +++ b/src/bin/pg_dump/t/002_pg_dump.pl > @@ -4591,11 +4591,9 @@ my %tests = ( > CREATE TABLE dump_test.regress_pg_dump_table_am_child_2 > PARTITION OF dump_test.regress_pg_dump_table_am_parent FOR VALUES IN (2);', > regexp => qr/^ > - \QSET default_table_access_method = regress_table_am;\E > - (\n(?!SET[^;]+;)[^\n]*)* > - \n\QCREATE TABLE dump_test.regress_pg_dump_table_am_parent (\E > - (.*\n)* > \QSET default_table_access_method = heap;\E > + (.*\n)* > + \QALTER TABLE dump_test.regress_pg_dump_table_am_parent SET ACCESS METHOD regress_table_am;\E > (\n(?!SET[^;]+;)[^\n]*)* > \n\QCREATE TABLE dump_test.regress_pg_dump_table_am_child_1 (\E > (.*\n)* This looks strange -- why did you remove matching for the CREATE TABLE of the parent table? That line should appear shortly before the ALTER TABLE SET ACCESS METHOD for the same table, shouldn't it? Maybe your intention was to remove only the SET default_table_access_method = regress_table_am line ... but it's not clear to me why we have the "SET default_table_access_method = heap" line before the ALTER TABLE SET ACCESS METHOD. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "If it is not right, do not do it. If it is not true, do not say it." (Marcus Aurelius, Meditations)