Re: BUG #18674: Partitioned table doesn't depend on access method it uses

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18674: Partitioned table doesn't depend on access method it uses
Date: 2024-10-28 22:48:30
Message-ID: ZyAUvpMjW3j8xMph@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Oct 28, 2024 at 07:49:54PM +0800, Junwang Zhao wrote:
> I think `default_table_access_method` should not affect partitioned tables,
> the partition's access_method will be default_table_access_method as
> wanted.
>
> But if it affects partitioned tables, then the partitions will always
> inherit the access method of the partitioned table.

Yes. default_table_access_method not affecting partitioned tables is
something that has been discussed on the thread that dealt with this
feature.

The point is for pg_class.relam == 0, which is a backward-compatible
way of telling that the partitions attached to the partitioned table
should use as AM what default_table_access_method is set to when a
partition is created.

relam for a partitioned table would be set only if there is a USING
clause in the CREATE TABLE or for ALTER TABLE SET ACCESS METHOD (the new
DEFAULT keyword can be used to set relam back to 0). There is a
pretty good chunk of SQL in create_am.sql for all these interactions
between the GUC, multiple levels of partitionining and partitions
attached. See around "Partition hierarchies with access methods".
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2024-10-28 23:17:57 Re: pg_rewind fails on Windows where tablespaces are used
Previous Message Tomas Vondra 2024-10-28 19:26:10 Re: BUG #18675: Postgres is not realasing memory causing OOM