Re: tablecmds: reject CLUSTER ON for partitioned tables earlier

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-27T07:48:27Z
Lists: pgsql-hackers
On Tue, Jan 27, 2026 at 07:13:04AM +0800, Chao Li wrote:
> I added two new test cases in 0002 that trigger the check.
> 
> BTW, this is the CF entry:
> https://commitfest.postgresql.org/patch/6415/. You may mark yourself
> as a reviewer, and once you consider the patch is ready to go, would
> you mind change the status to Ready For Committer? 

There is more to this set of changes than it looks at first sight.

Hence, one question about 0001: can the previous error path in
mark_index_clustered() be reached through a different mean than ALTER
TABLE?  If yes, we should have a test for it.  If no, it could be
switched to an elog(ERROR) or an assertion.  The code paths leading to
the previous error should be analyzed further.
--
Michael

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