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: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-23T07:53:06Z
Lists: pgsql-hackers

> On Jan 23, 2026, at 15:43, Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> 
> Hello!
> 
> A simple patch and generally looks good, I only have a few observations.
> 
>> “ALTER TABLE … CLUSTER ON” and "SET WITHOUT CLUSTER" are not supported for
>> partitioned tables, but currently ATPrepCmd() allows them through and they
>> only fail later at execution time.
> 
> Looking at the ALTER TABLE documentation, for other options there is a
> mention like "This form is not currently supported on partitioned
> tables." / "This form is not supported for partitioned tables."
> 
> I don't see this mentioned for CLUSTER or INHERIT. Maybe it would be
> better to also mention this in the documentation?
> 

Hi Zsolt,

Thank you very much for your review.

I have the other patch for the documentation update, see [1], that is an overall clarification for alter table behaviors against partition tables. Actually, I just found this issue while working on that patch.

I will handle rest of your comments soon.

[1] https://www.postgresql.org/message-id/CAEoWx2%3DmYhCfsnHaN96Qqwq5b0GVS2YgO3zpVqPPRd_iO52wRw%40mail.gmail.com

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