Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkEvE-00CJBJ-0Y for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 05:13:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkEvB-006Kdj-2z for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 05:13:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkEvB-006Kdb-21 for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 05:13:53 +0000 Received: from mail-dy1-x1329.google.com ([2607:f8b0:4864:20::1329]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vkEv9-00000000UFX-1ycd for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 05:13:53 +0000 Received: by mail-dy1-x1329.google.com with SMTP id 5a478bee46e88-2b7070acfdcso4668158eec.0 for ; Sun, 25 Jan 2026 21:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769404429; x=1770009229; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OUXQLd3Fq5eAsB88nNrLz7byTjHWP9vFOAVXzt13EzY=; b=lrRmgWuL8GawbsNspORKLPcFy0jl3n6K1fBtwZXqyqyYCSWhad+Otyvs1ev8j3qHM7 SHxQCDQOyur/gkCalzEUv0GEQn9d9CQjxD36p5DrihVaU9SCX+SJkgZ8cKaexcGbL6HG JHYG4tJsU2CixR5skrKF7+w7IuMZrYkRBQgvaVIi6IYTowE9nENyGHokQsQFLd8AmGFV 4IQu1NuQGkJ1QvJa/pI0GO2t+jMw/v6ePTkDkkpgS1cODtVea9KYOG+8mN01TazoJAgJ PiSt3MzPH1hoY6k6GDlRrDB84jpn1Dp4Ar+hOIzukfOIFsO5c7gpTQpTOjxKigpJHxAH OQwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769404429; x=1770009229; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OUXQLd3Fq5eAsB88nNrLz7byTjHWP9vFOAVXzt13EzY=; b=Yt6Jcpd90I27yXMeUmSA0kABWYyj86aseoEPsB3rsOlO7/0YgUV1EZCZKkP0GmqzPO l4L2YQ0f1L7/iPpfIeMIoBvzBfxDKMllMENXdxlLzno/fBht7VsDMxfCUmaobmucl1lS 0gOy9X5p/w+68uAaUlw0sYlrkisAzt9hrcRjpkPrsddh5KXASW5zEpoJkWbImAPWOr9u S9sIPe00/poO/HWYJLxpuq1irPNaAFS+Fq7ttc4WcxgR360Hucb/JBYIm3WIql4qxTlb JYJFPX58sQ8NCs+4puHpdbF/8XZvZ5uBqgv3s8vHlF98NHqy00b1xwRB30ywIMXiYTOB 1J6A== X-Gm-Message-State: AOJu0YylAgqh59fktsk240QDa33J8ulAcRfNyaCQ9kA9f2N55+1seLRQ 1DhPWWQMpDdFwQNdjm+8/Rdjc6WVDPd9zSBi3wM/7pPMPS0dx+TF3Qtm X-Gm-Gg: AZuq6aIjg9p47jXWy7bbP7GyEvvbVzpifP3ARpczw7DcMXIW/IWUxsLB9M2laTS430s P+coSCv/KPrad063ldVoqe8f9OkXOk38P+S6Qbl1B+5uuemWeD7DIlUYHn/RL20hlGkVcYRW8Pi iq6Ffk9LsYGuExrYN6z2H4Rien5OSaf7kJx0OViGY2v4Dd5QV84tDmJGTxqyUqBxly+w7JSaIiL KkneoaPY2u/ykQNE4zC+M2lV13Y17Cjt0eqWK0zxPzRL1lF2UQP/DyzXzC3xUgRFFj/nfWiK8h0 ab1pWX2TFLOj9KwTRPUhsYaq7YEOcLC/dNCgQhDRRYqJoqoXuvWDs6Lzv5tkLDpM/iEI11VD6Qj Lgx6wL+1M8fVQt8a55XRuVUuycq6nrUNz2+234VfTI5qd692z+KN5QjO8aTjRhznrwRDY3FEYaa XlHNgAlPq3m6yPOBE2BA== X-Received: by 2002:a05:7300:dc97:b0:2b7:3538:ce5c with SMTP id 5a478bee46e88-2b76421b0b2mr1393716eec.2.1769404429468; Sun, 25 Jan 2026 21:13:49 -0800 (PST) Received: from smtpclient.apple ([64.32.14.230]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b73aa03ecasm11841546eec.27.2026.01.25.21.13.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2026 21:13:48 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.300.41.1.7\)) Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables From: Chao Li In-Reply-To: Date: Mon, 26 Jan 2026 13:13:14 +0800 Cc: Postgres hackers , Zsolt Parragi , Amit Kapila Content-Transfer-Encoding: quoted-printable Message-Id: References: <90F9169D-135C-45E5-8221-4F79DAED98E2@gmail.com> <46DA7611-C18D-4782-AEFF-F861ECDEFA5C@gmail.com> <245AA9F3-7577-46D6-990C-C308A9F36E82@gmail.com> To: "David G. Johnston" X-Mailer: Apple Mail (2.3864.300.41.1.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jan 26, 2026, at 12:36, David G. Johnston = wrote: >=20 > On Sunday, January 25, 2026, Chao Li wrote: >=20 > > > > When applied to a partitioned table, partition columns and = constraints > > are implicitly renamed. > > Specifying ONLY is not allowed, and this = command > > cannot be used on individual partitions. > > >=20 > But for "Specifying ONLY is not allowed, and this = command, cannot be used on individual partitions.=E2=80=9D, that = doesn=E2=80=99t seem correct. See my test: > ``` > evantest=3D# create table root (i int, j int) partition by list(i); > CREATE TABLE > evantest=3D# create table p1 partition of root for values in (1); > CREATE TABLE > evantest=3D# alter table p1 rename to pp1; <=3D=3D Rename a partition = is allowed. > ALTER TABLE > evantest=3D# alter table only pp1 rename to p1; <=3D=3D ONLY can be = used, but just no effect > ALTER TABLE > ``` >=20 > 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. >=20 > But I=E2=80=99d accept a sentence like: =E2=80=9CTable renames always = only apply to the named table.=E2=80=9D Added to that paragraph; it=E2=80=99= s a convoluted command. >=20 > David J. >=20 How about this: ``` When applied to a partitioned table to rename columns or constraints, the corresponding partition columns and constraints are renamed implicitly. ONLY is not allowed, and the command cannot be used on individual partitions. When the rename target is the table name, only the named table is renamed. ``` Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/