Re: tablecmds: reject CLUSTER ON for partitioned tables earlier

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-16T09:07:51Z
Lists: pgsql-hackers

> On Mar 16, 2026, at 16:51, Michael Paquier <michael@paquier.xyz> wrote:
> 
> On Fri, Mar 13, 2026 at 11:38:17AM +0800, Chao Li wrote:
>> On Jan 28, 2026, at 10:15, Chao Li <li.evan.chao@gmail.com> wrote:
>>> * In 0001, replaced ereport with assert in
>>> mark_index_clustered(). See my previous email for the analysis.
> 
> I have looked at this one, and I think that it is right.  Even in the
> CLUSTER/VACUUM path, we have a relkind check before the sole caller of
> rebuild_relation() that discards partitioned tables, so we would never
> read mark_index_clustered() under this relkind.  Applied.

Hi Micheal, thank you very much for pushing 0001.

> 
>>> * In 0002, removed the redundant check of relispartition from
>>> * ATExecDropInherit().
> 
> I have not looked at this one.
> --
> Michael


Basically, 0002 does the same thing as 0001 just on a different sub-command of ALTER TABLE.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







Commits

  1. Refactor some code around ALTER TABLE [NO] INHERIT

  2. Add regression test for ALTER TABLE .. NO INHERIT on typed tables

  3. Reject ALTER TABLE .. CLUSTER earlier for partitioned tables

  4. Ignore partitioned indexes where appropriate