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 1vjE4Y-00BQEQ-19 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 10:07:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vjE4X-00H3Ee-1c for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 10:07:21 +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 1vjE4X-00H3EW-0P for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 10:07:21 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vjE4U-000000004KJ-2H1J for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 10:07:20 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-79420190633so19361327b3.0 for ; Fri, 23 Jan 2026 02:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769162834; cv=none; d=google.com; s=arc-20240605; b=PDi0AG+7TMek7fsYLVWI/rpZeBeMb+CAUUzrnTsze1Vcuvnvj9pEmKmG/OD3f8bd73 j4T463jFrULk9XR80TOlb91HOFR84szkd9bEDhiA8rXe8Orgmrf7LBpAjDVbFEwqmMZV in6Aw5E3dr9aLnQHX0Jls7S1LgE4kUYEj4UY6BxEOzPpQ0c2l/JlAkvZObPYOO9W3Osx W8oajOpR1BJrvDl06Y7aBXpK0UmcYReCoCxAnHA48GiQNUxVPcKses4M3nEou1UnV1Zd WLjWPD8NvcDxerK1wx0/eFfFOcHOtbhK2a3WEQndkc/8yoaN/iTmWB/o7Ip0NKnPPhkB 6c7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=03oL1140/3ZVgI1vXovvOEget1k1it+BEvw6wM7ifTc=; fh=lzIWv/SudnimPCTqr+Tt5Oi9ONPnxcFhuh80EYwDEFU=; b=B6chong33pJ5oJoZwLuAvLjrwAuMg+Wr4Poc04HU7vkGWvCMCc0kKI3iOhai5ODEjc nBlOYxfq/MqOfE29PoDbH34i02zAhSNd2RxncLdtpG7tXbfPPpyi2oVs8cVQRJ3fpM23 HoOCr7lErJKnFWkDMGSeMSyqvdiZl/OX0yfD5K5gOt38BP3NXiCvyljjxnC5tSm05emJ /kbKaXpBhg0oWqP50bscZF75yudV0a9PQ8vPHqOYJ6mGfQs/lzj21jA2QmRguxm92qGI oKplpy6ox0ImK6fH+FHBMFnq2eMYcS40RDKG+26mD9XZdsNKAbW5r7lswCJt+oQuGzSe FaJw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1769162834; x=1769767634; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=03oL1140/3ZVgI1vXovvOEget1k1it+BEvw6wM7ifTc=; b=V8alWljPAz8BaFxkXZ2ttqoytVHJDAKkfewabRuQf0vg7Fnz19k8jRvGMgZj764Vg0 m03hodEwZ+5uUMpHzz2wI2nBMZuAU1wFXBKvWWtS/peOFhKlSTnhEgnrMJWcmO27qZnO 7SIORqtG5UYxPSVNxKFaILh3o2CwxclroG29s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769162834; x=1769767634; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=03oL1140/3ZVgI1vXovvOEget1k1it+BEvw6wM7ifTc=; b=Ju9J5AXGxDTHwlFR7aAAt2m7LMN9n+iSpNzCCGQz5Eu/pmOBOc0V0U3Zk4aiEKhh7p OgOtjA4DCiniGAvt+LcVFwoCa2zQSmhnRjg0QQkRaGpNo445oiCH6OuRqRrBCPxaHljP Uld8b+Ngt/j3h6V8sfMrB8Df34LYH4+JxumxZdBcOzc+TVvlHR21Y9rlhE2O201p9Wxf +gn1ncr3kQHgqhv2nmjNjCycUxlzCpI670IVD8j5bIDUyK+hVxdZ2/aUhf1Amm35Sn3z 1S1dY/MuLmaispN90p/2/CvU6iKdr926Ug2YOoX5ZtJJIE4QPbIb4XgBmFsdnJBP9fLU Q5Hg== X-Forwarded-Encrypted: i=1; AJvYcCWf2vOwuC/p67dG1dpWl31Xt0C7YrScJ1yHvWJ+v6ge4dFBiihZ9E1FtrxLO2OY+rlbDwZMUiCQ16sERQzQ@lists.postgresql.org X-Gm-Message-State: AOJu0YxRA0lFikXFvA2mueMD8saaUrPYmh7ZPY2+tjTlRRIGx9LUlCei 9zvl3wVB5T3KplCqXOk2pBALqvaKyDXu5CVqPXUiACFB4K7r23zKLKQyue17wz/JOv7O05lBNWr DupAwdeiR0XIpXNwUYdt4HaavYjHZZHZiS1rv1Lelkbg8xk7NQ06zuAOTKjSp1KgM0iFRGc2qyG nRve+JpPguYvHgv78DmS5FS+NoV7tXyrUfdj6YKxlNMjbp4S8KyG3Vr0wGc6byZWeAOPBsSDLrF /7FqsM7U7U0BIII/C01MFdpjnPhKylKOd6ONpiWIFWdk3hSuple0jvno8PHIgbFFLA= X-Gm-Gg: AZuq6aIP50YVr8utlp6hE2j/cpwygHBniyBRSYXUy4l7LaCKedG3cqcx2IC5Cl8UOJp ADgm93rM/EaH4hPXABKkwfvR4OpxXUDRySK3Yp43OaU7SuuOHzQuXo7Wt1kD+FYPJ+TtDqjDymj rSCChbfAkwt3/iG8cnUW3OpwGKk4NwpymJKrSMy48I5o2xPMF2bltUbd3fe9AqaXytir20pO1gb b7KyiNsm4FSd83fsEWsqPC+Y0CLEm5rzwzopAuGhz/6Y8mLbrrJUoDCx3fuRzvZ1Uki+flAjyUh Q9Vl2pGUzexJQ4TLyv0mA9X6d374/Dg98ActkhEWopHvbHyBXqjKmCQR X-Received: by 2002:a05:690c:86:b0:78c:6771:77bb with SMTP id 00721157ae682-794398f8446mr19311257b3.14.1769162834266; Fri, 23 Jan 2026 02:07:14 -0800 (PST) MIME-Version: 1.0 References: <90F9169D-135C-45E5-8221-4F79DAED98E2@gmail.com> <46DA7611-C18D-4782-AEFF-F861ECDEFA5C@gmail.com> <245AA9F3-7577-46D6-990C-C308A9F36E82@gmail.com> In-Reply-To: From: Zsolt Parragi Date: Fri, 23 Jan 2026 10:07:03 +0000 X-Gm-Features: AZwV_QhX73SZIdTqOiJLUknLQ1OfhA6b0kNYyoGXYdGm44xZZj5INNpSiuHtxxs Message-ID: Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables To: Chao Li Cc: "David G. Johnston" , Postgres hackers , Amit Kapila Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Really good changes! + When applied to a partitioned table, the constraint is altered on the + partitioned table definition is implicitly applied to all partitions. an "and" is missing here (definition and is) + When applied to a partitioned table, partition columns constraints + are implicitly renamed and specifying ONLY is not allowed. + "partition columns constraints" - that seems like a strange/unclear wording to me. maybe ", the partition's column constraints are ... " ? + + When applied to a partitioned table ONLY is impli= cit, + these forms must be applied separately to the partitioned table and/= or to + individual partitions. + "When applied to a partitioned table, ONLY is implicit and ..." (at multiple places, this is an example) - - A recursive DROP COLUMN operation will remove a - descendant table's column only if the descendant does not inherit - that column from any other parents and never had an independent - definition of the column. A nonrecursive DROP - COLUMN (i.e., ALTER TABLE ONLY ... DROP - COLUMN) never removes any descendant columns, but - instead marks them as independently defined rather than inherited. - A nonrecursive DROP COLUMN command will fail for a - partitioned table, because all partitions of a table must have the sam= e - columns as the partitioning root. - "A nonrecursive DROP COLUMN (i.e., ALTER TABLE ONLY ... DROP COLUMN) never removes any descendant columns, but instead marks them as independently defined rather than inherited." This part is now undocumented, it was only mentioned in this paragraph. > C2 - Sub-commands where using them with a partitioned table will automati= cally propagate to child partitions; ONLY prevents propagation; new partiti= ons inherit the parent=E2=80=99s new setting; and child partitions can be s= et to different values than the parent. The documentation of this group is inconsistent. DROP CONSTRAINT mentions that individual partitions can be dropped separate= ly: + When applied to a partitioned table, the constraint is dropped from + all existing partitions unless ONLY is specified. + Individual partitions may drop constraints independently of the + partitioned table. But most of the sub commands in the C2 group leave the last sentence out, and also the C7 (ADD table_constraint) Also, isn't DROP CONSTRAINT on a partition limited to constraints defined on that partition? So it would be better to say "may drop constraints defined directly on that individual partition independently". CREATE TABLE parent (id int, val int) PARTITION BY RANGE (id); ALTER TABLE parent ADD CONSTRAINT val_positive CHECK (val > 0); CREATE TABLE child PARTITION OF parent FOR VALUES FROM (1) TO (100); ALTER TABLE child DROP CONSTRAINT val_positive; -- ERROR: cannot drop inherited constraint "val_positive" of relation "ch= ild" + When a new partition is created, it generally inherits the current + definition-level properties of the parent partitioned table. Maybe something like the following? When a new partition is created, it generally inherits structural properties of the parent partitioned table, such as column definitions, constraints, and storage settings. To be more explicit about what's inherited, and not only focus on what's not. (The commit message also says that the change describes both what's inherited and what's not inherited)