pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: pgsql-hackers@postgresql.org, Ashwin Agrawal <ashwinstar@gmail.com>
Cc: vanjared@vmware.com
Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Date: Thu, 29 Feb 2024 08:51:31 -0600
Message-ID: <ZeCZ89xAVFeOmrQC@pryzbyj2023> (raw)
In-Reply-To: <Zd7qEUKkBVY0d2-4@paquier.xyz>
References: <ZCUZLiCeXq4Im7OG@telsasoft.com>
	<ZEccbkBYCMy42Rxt@telsasoft.com>
	<ZG8E6DggGkPyEPPx@paquier.xyz>
	<ZHfZxjcR0J9Ws7ze@telsasoft.com>
	<ZHiUKhhT71X4CjJl@paquier.xyz>
	<ZLgn3Ou4YpgP8Z8l@telsasoft.com>
	<d1cb16ec-9af1-4657-81f2-865480d2bd6d@eisentraut.org>
	<ZdWa0sSExPfBvAyR@paquier.xyz>
	<cab23590-19d4-4895-9333-1c25f4194741@eisentraut.org>
	<Zd7qEUKkBVY0d2-4@paquier.xyz>

On Wed, Feb 28, 2024 at 05:08:49PM +0900, Michael Paquier wrote:
> On Wed, Feb 21, 2024 at 08:46:48AM +0100, Peter Eisentraut wrote:
> > Yes, I think most people agreed that that would be the preferred behavior.
> 
> Challenge accepted.  As of the patch attached.

Thanks for picking it up.  I find it pretty hard to switch back to
put the needed effort into a patch after a long period.

> I have implemented that so as we keep the default, historical
> behavior: if pg_class.relam is 0 for a partitioned table, use the AM
> defined by default_table_access_method.  The patch only adds a path to
> switch to a different AM than the GUC when creating a new partition if
> and only if a partitioned table has been manipulated with ALTER TABLE
> SET ACCESS METHOD to update its AM to something else than the GUC.
> Similarly to tablespaces, CREATE TABLE USING is *not* supported for
> partitioned tables, same behavior as previously.

This patch allows resetting relam=0 by running ALTER TABLE SET AM to the
same value as the GUC.  Maybe it'd be better to have an explicit SET
DEFAULT (as in b9424d01 and 4f622503).

-- 
Justin





view thread (71+ messages)  latest in thread

Message-ID: <ZeCZ89xAVFeOmrQC@pryzbyj2023>
Permalink:  ../ZeCZ89xAVFeOmrQC@pryzbyj2023/
Also on:    postgresql.org/message-id/ZeCZ89xAVFeOmrQC@pryzbyj2023

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, michael@paquier.xyz, peter@eisentraut.org, soumyadeep2007@gmail.com, zyu@yugabyte.com, ashwinstar@gmail.com, vanjared@vmware.com
  Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
  In-Reply-To: <ZeCZ89xAVFeOmrQC@pryzbyj2023>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox