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 1viOMW-004wNu-0U for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 02:54:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viOMU-004Qn4-0G for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 02:54:26 +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 1viOMT-004Qmw-2E for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 02:54:26 +0000 Received: from mail-dy1-x1331.google.com ([2607:f8b0:4864:20::1331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viOMP-001dkQ-32 for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 02:54:25 +0000 Received: by mail-dy1-x1331.google.com with SMTP id 5a478bee46e88-2b1981ca515so6607792eec.1 for ; Tue, 20 Jan 2026 18:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768964058; x=1769568858; 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=JUTZHSGKNEqQSzNB9hrk1HUpCPVG9MxY08RGXuELrhU=; b=CNKENYtgtzpumefu2J/wXpxgVukQ5EVx5s0A/uS83V8W8X57JNzwNyNawGyHHICS1p fFi8hSMoEuTNPASv3fIi9upv6U6Wt2n75AieVvx7wal61JAgCKuR9Bap3ocEqo0iOQLH fb9ec2hllEEKmDcS55iurkX5WjdBB0FTD6b/Roh0Ugd4eIMf6HKAsp1sJGFceM7oBx3D rJj4Fq/1KKVsNiwFkWTeoLlSeS3uYeXooHWXuqnG944lTJBoPBfi07JQpZPWTJl6EY4I jnavUvCc59lSxfTdphr7oFPPC/DIqQQ7AeWTmIBMiu2UP7FR0ROLqe2Dt5+ruhkwANFA ak4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768964058; x=1769568858; 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=JUTZHSGKNEqQSzNB9hrk1HUpCPVG9MxY08RGXuELrhU=; b=nHl+k8pSXBTkhBLGRXzVrUv/AjMBc6+ZY7jr6F0FL8fEUug1Nq33y48bEw729KqLC/ fhdMApnyDFASh7HDSkfI8H5ZumtAunfaUPAsz6Ve+VeyU59OpTzpfUx3bic4PB3MsDKd XPSH++pQ4d+g89jJXhhkISYlPFSGDK0EVAjFWZDBneCr1zgnz/VEnsj6B4nws34uXy5u w/b8lgAK3U5KkcaKIpj1YcGzmnncIE7Wcno6NCbCZE8XCCeM0NvsvlaV5gKk1Wt9wd2e mN1LaGfq6wHcd5ueatwi7oDf0PIw0OMJUdkgrSd6rvzi7R+yv+6d3edEzCimLT56nsQ8 pRGg== X-Gm-Message-State: AOJu0Yw4ujLxwHLh2TwgsE43cHbxCS8CwxgelsBjc69eaSUt7SUwEzR7 fRhhhe941OYf4s8GMvWuBZr2AgsfvfdJ0AEiPDvkGvSm9xyBPdXm0uNa X-Gm-Gg: AZuq6aK/8FrZnuvFQXhrwytmhwqPiTBcqvgW3I1znQxJQt5FnAG04yNKRMxe5EYRjGq 41Vxm7eEWJpsrA1+lFh9nWrhYVWirwH9Ma4nEieyGdyhZVNNiJLPY0USnDL001QYfL82uBpqR2z nbC2FtrGuNXHTsOKNqrNXlmk76wMLtqys3nILJRuQH1p95XxjyOBIRQq+yiDAmFfqXMm+v/dTyo d2pT3oxpLFJHnn8uNQMRl+7vS5aNiM21RMTvo5Ad+iR/E9n9gIFFFDsUMso2oLZfzGi2DYtaGiE VicruofQFXGROy14+s6kimkPpMDvwDmSZVyIzv4SzgWys6V81FPZGfLbJXuWlhGN7Vkh3YpKC0t EkaGME99udskuVbmxzv+f6bvC15AfkeVdLN6hC9C+cEnJa7Hwn93jZmq17VvWgCMJfQXJrVTBSp V02DWhaJdxd7B/F/4H4YDg X-Received: by 2002:a05:693c:3002:b0:2b6:c617:f792 with SMTP id 5a478bee46e88-2b6fd7bc6acmr3018381eec.20.1768964058344; Tue, 20 Jan 2026 18:54:18 -0800 (PST) Received: from smtpclient.apple ([142.171.105.12]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b6b361df88sm19223246eec.18.2026.01.20.18.54.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2026 18:54:17 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.4\)) Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables From: Chao Li In-Reply-To: Date: Wed, 21 Jan 2026 10:53:43 +0800 Cc: Postgres hackers , Amit Kapila Content-Transfer-Encoding: quoted-printable Message-Id: <245AA9F3-7577-46D6-990C-C308A9F36E82@gmail.com> References: <90F9169D-135C-45E5-8221-4F79DAED98E2@gmail.com> <46DA7611-C18D-4782-AEFF-F861ECDEFA5C@gmail.com> To: "David G. Johnston" X-Mailer: Apple Mail (2.3826.700.81.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jan 21, 2026, at 09:09, David G. Johnston = wrote: >=20 > On Mon, Jan 19, 2026 at 1:20=E2=80=AFAM Chao Li = wrote: >=20 > Thanks again for your review. I have integrated all your edits to v4. = Once you consider the changes are okay, can you please mark the CF entry = [1] as Ready for Committer? >=20 >=20 > v5 Attached with a delta. >=20 > There exists described behaviors in the notes that are being removed = that need to be retained; pertaining to inheritance setups. I put a = note in place of the removals pointing out that when inheritance is = being used for partitioning the rules for partitioned tables apply = (implied 'unless otherwise noted') and that local/independent objects = can always be addressed normally. I then incorporated the notes into = the appropriate sub-command sections. Please give it a sanity check = since I'm still getting my head around all this. >=20 > David J. >=20 > = Hi David, Thanks for your continuous review. I just checked the delta: 1 - DROP COLUMN ``` + + For inheritance setups, a descendant column is removed only if = both: this + is the only parent defining the column, and the column was never = independently + defined. + ``` The meaning is basically correct. I dislike the statement of =E2=80=9Conly= if both:=E2=80=9D, can we rephrase like: ``` For inheritance setups, a descendant column is removed only if both of = the following are true: this is the only parent defining the column, and the = column was never independently defined in the descendant. ``` What do you think? 2 - ADD table_constain ``` + + For inheritance setups, the constraint is not added to child = tables + unless it is a CHECK constraint with the = (implicit) + INHERIT property. + ``` The meaning is also correct. I want a slight tweak like: ``` For inheritance setups, the constraint is not added to child tables = unless it is a CHECK constraint that is inheritable (that is, not declared NO = INHERIT). ``` What do you think? 3 - VALIDATE CONSTRAINT ``` - independently of the partitioned table. + independently of the partitioned table, so long as the = partitioned + table itself is not yet validated. ``` Agreed. 4 - DISABLE/ENABLE TRIGGER ``` + + For inheritance setups ONLY is implied, though = it may + be specified. + ``` Agreed. 5 - RENAME ``` - For partitioned tables, this form behaves the same as for regular - tables. Renaming a partitioned table, column, or constraint does = not - propagate to partitions. + When applied to a partitioned table, partition columns = constraints + are implicitly renamed and specifying ONLY is = not allowed. + + + For inheritance setups, index-based constraints are always = considered + independent. Dependent columns and constraints are implicitly = renamed + and specifying ONLY is not allowed. ``` Here =E2=80=9Cspecifying ONLY is not allowed=E2=80=9D is wrong. ONLY can = be specified, but has no effect. So I think we can use the statement you = put to ENABLE/DISABLE TRIGGER: =E2=80=9CONLY is implied, though it may = be specified=E2=80=9D. 6 - Notes ``` + + For inheritance setups, the behavior described for partitioned = tables applies + only to the dependent column(s) on the descendant table(s). It is = always + allowed to target a descendant table with column altering commands = on independent + columns. + ``` Agreed. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/