public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Chao Li <[email protected]>
Cc: Postgres hackers <[email protected]>
Cc: Zsolt Parragi <[email protected]>
Cc: Amit Kapila <[email protected]>
Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables
Date: Sun, 25 Jan 2026 21:36:15 -0700
Message-ID: <CAKFQuwa9OEJ_sygQi3fNKxzQz7M6V7-zu=4fL0rquXCjudUoyw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAEoWx2=mYhCfsnHaN96Qqwq5b0GVS2YgO3zpVqPPRd_iO52wRw@mail.gmail.com>
	<[email protected]>
	<CAKFQuwbWNCX1M1e9_-3P9RVGo10huPjuqdL74FJ+-a5EW791KA@mail.gmail.com>
	<[email protected]>
	<CAKFQuwZ+o6La5DyK9_-L2gpeiKNvGMbR78UjocO4++JkyZaRHw@mail.gmail.com>
	<[email protected]>
	<CAKFQuwabxFyFQob=RfKOV3upjxwomAzmGzSouN-h2ypuXz+dZg@mail.gmail.com>
	<[email protected]>
	<CAKFQuwZaquUrTOhfmJ2CenwiyAHx4nORQ0kB01sL+z5pCBuLFQ@mail.gmail.com>
	<CAEoWx2mUiCYJEBuo5D74gi7pHfNz82b54oDHjZNtrXRFDnBPOg@mail.gmail.com>
	<CAKFQuwbQ=L8w8jEaB8_gW-RrNv2_V-VrFYBump7__z-vh-QJWw@mail.gmail.com>
	<CAEoWx2nwoBtWX3=UOQQpGZOuRH5vNv2PHqeFHqDPdiKGaOigiA@mail.gmail.com>
	<CAKFQuwZyJNBN+N5Qtcg0aG6ZpOFvQV5m=cALLgv7g3u1Sz-tZw@mail.gmail.com>
	<[email protected]>
	<CAKFQuwZr_GLBOOLohfEcKVVTcP9D+nzVdUUKabYbXWXRnOFjnA@mail.gmail.com>
	<CAEoWx2=CK=QEvpL5HSgFEuFqjO2Q1sDy6a2G-s-+zv+RzB3mTw@mail.gmail.com>
	<CAN4CZFNoLSUcVKcOOJgOtTkDuOseCL5j9MQr3tGjb3btD=jHNQ@mail.gmail.com>
	<CAKFQuwZwAuO3qXEeqxwV6vM+89BkB-aSkcXqDGG8e_xBy_Q3Xw@mail.gmail.com>
	<[email protected]>

On Sunday, January 25, 2026, Chao Li <[email protected]> wrote:

>
> >      <para>
> >       When applied to a partitioned table, partition columns and
> constraints
> >       are implicitly renamed.
> >       Specifying <literal>ONLY</literal> is not allowed, and this command
> >       cannot be used on individual partitions.
> >      </para>
>
> But for "Specifying <literal>ONLY</literal> is not allowed, and this
> command, cannot be used on individual partitions.”, that doesn’t seem
> correct. See my test:
> ```
> evantest=# create table root (i int, j int) partition by list(i);
> CREATE TABLE
> evantest=# create table p1 partition of root for values in (1);
> CREATE TABLE
> evantest=# alter table p1 rename to pp1; <== Rename a partition is allowed.
> ALTER TABLE
> evantest=# alter table only pp1 rename to p1; <== ONLY can be used, but
> just no effect
> ALTER TABLE
> ```
>

I was mentally restricting the second sentence about ONLY to the column and
constraints renaming action, which are called out by the first sentence.
It makes little sense to talk about renaming the table, parent or child,
here in the context of ONLY.  It goes without mention that table renaming
never cascades.  Only is implied for that action, even if only should just
be considered valid on a parent in any case.

But I’d accept a sentence like: “Table renames always only apply to the
named table.” Added to that paragraph; it’s a convoluted command.

David J.


view thread (19+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables
  In-Reply-To: <CAKFQuwa9OEJ_sygQi3fNKxzQz7M6V7-zu=4fL0rquXCjudUoyw@mail.gmail.com>

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

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