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 1vj9xa-008n1R-0n for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 05:43:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vj9xZ-00GEra-0D for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 05:43:53 +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 1vj9xY-00GErS-2K for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 05:43:53 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vj9xW-000000003UN-2gAH for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 05:43:52 +0000 Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-5029fb0b977so19036931cf.0 for ; Thu, 22 Jan 2026 21:43:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769147029; cv=none; d=google.com; s=arc-20240605; b=brwgY6Huw4338SNMRkBQPwL4SbSpS5dXI5wcXWCiXgL34QTfqgGTvLUBGHwSOhGf1R YuvcBaqwvn9hEGdWIZheJWcEs4JSxMxn1Wj7kG1C1m5mqevGXp8u9boEc+abMKHe5stB Z2c1WW5FXV1D5umvOp7Rz0xUyhmjY6XpDuvPvX5Ld8UmNZhFuGoiydZvZyGxAWEyQVm6 izLqo+XbpW7XEjcK6/E6HWxjGMMA06mt+FbGKrXcRNQ2IHsTWTZADOtpJiXqVtOCQ+Vx NJGMz+wHF8rbpdxCpoVRTvhcx938fA6fKbc7IVNruWDm28wof9CxkW7TRYt2e9awXoB+ ek4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=/f9B87L30HcyruUXgyobVu9c6XENv6KL9Be5ebbPFHA=; fh=gh6ydAwGXE7AqFf0FBE+dTK7irKcOuLJpYbFZaK03zU=; b=lt1LWG3Lg2HcMQH5RsUcAnBV7FnJVxd3bTLWce44UfTmyqnoZ/nDV9Hvn+OZmHDR95 diYPrXD3yHRE9WE4KwOds+MLzKpiw7DjO3RqMKISFBKZu63rZU/SQvW7SscQ+L+0hd8a bgpiJrV2i5JxzENn/IyGJRCWbGs22pMk2rO0DcLjkwAz7dYe5EsUNwPpA5mjSV50UVkE ynxM5r5atS6lfz0dMuT5ArUAT8b5j2A19r6FG0w1iQnz+UT6pzGYePfpl1NQ36rGPKvV UTRrrvEoN9E6KtAEZVWTnP78DunFnEzMUSo1lqOSVKGxoUftRTE20HCClIOlRSrlsLCV pvPA==; 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=gmail.com; s=20230601; t=1769147029; x=1769751829; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/f9B87L30HcyruUXgyobVu9c6XENv6KL9Be5ebbPFHA=; b=lf97Yo3Dfuat3bz3Q6WFESTkdb/cU75p7jukSnafCtN6zzbKPzJRucwcDsneYn7eZM fA+eHzMZW1/qfxn+AIqVrBGGATwblV9cVESsbx3yEK+hZCZ1XczzahgmE8Y43fbkrlTf WYE4b3vie7FpizB1CId5CwhC5FvcakSlPmoroxhspKmmuwDoc0qXDwE8ECVRlriEeGKc 0OuvX3bnKrJwLUFSlrddLo5xLL1idRm6rUMDPgp6YNGXoQnVKtV4Rjb/uK2riZ9X4Vux irG5G+4WTSrglZ0fy74dNhe+ais+8gX4LGaIVV1wFQ4yGHaYzoGdtFW53gCPsklUZghu 9Gxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769147029; x=1769751829; h=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=/f9B87L30HcyruUXgyobVu9c6XENv6KL9Be5ebbPFHA=; b=LjrQGYEJKVM9Hv3zn1MnGhRVRSFsdJUQeXDTi6kasjTGMfyyRnxs8Ofk7Sdz0W07Zd 2rOpxIcNOuAcEPP01XQiR0YlvByzzDDl+ZVFotus5hzd5LZDuQ2WEwHcucOspL9C5CPj JnqIZl8KtOY6tUiu6LRLAAhcMdO76jSb1kQUuDRL/4Uq4M+mkE4kfyal69GsvIEYDBNJ tpJMR6IUQWKtYvogJborQpR2RMa8KlDwY2m+Zkyep8pVmmpVmXOO5v1SZIoxBmT/D+fQ E5JiWMM+xFIfsVBQCDHagEf0bVv9zrEdLNK2ie/1NqejzhEIjx4fnJAjRKGAW76qiqVr QywA== X-Forwarded-Encrypted: i=1; AJvYcCXXwcxHHRl4+QzbRz1R93SY3/z5tlL5Hhc4PeOGdV6GZNH9t2VE0Trf4/gOxIpvR8TqMvzxOw0iwJQHLMdl@lists.postgresql.org X-Gm-Message-State: AOJu0YyzYZ2ksvpDPUR21/WtKR7P9PsTlAxiyBjO0zWhNtkeRfLjzHPr 1JwZn1hFmeC0X91rLrtL4NFiZTxR8Bk9+Ryde8uU29uxxsR8l3DBefvhqas6ipqxnxI+ERah0fN RBad531CMEfNedr7LdhiyZRJScri+cg4= X-Gm-Gg: AZuq6aJQPegLcAFq3t1oE4jDWzG4F6DDKQhFjHnqcUJrr7eCg0V9Qr++F6oDhu8kRGd heN6y3xbvmjdDLZuiOikU3zMHIKrhXr8xyfslkgRh8VHZ5fjMUBesdeqMZTdITNcAv0gghXX/bo QNpoOJyEZ8FoQFr+N1JVGPmhw03Y3p5jxftYu6RGRfo0rBHxi9SOq73gPDm0Po7SW0TiTEZtruc jwa6ShKf6Ap1QsHRT0E2nRWA5Y54sI3BrldlNeywe3x9L1yxhYsWAPuypzWUi2Rj5WS+uSMxO4l +vR8q4mkLbqj0H+yfILtyBxBA88YcQ== X-Received: by 2002:ac8:7dcc:0:b0:4ee:1b0e:861d with SMTP id d75a77b69052e-502f77601eamr28421081cf.26.1769147028666; Thu, 22 Jan 2026 21:43:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Fri, 23 Jan 2026 16:43:21 +1100 X-Gm-Features: AZwV_Qg_vwlNkEeHegMl6X5GSRhWdam6O679vfS8iiV_6wScSCaS-_52rG3LJqw Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: Dilip Kumar , shveta malik , Amit Kapila , vignesh C , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Shlok. Some review comments for v36-0001. ====== 1. It seems that most of my v35 public/internal review comments from around 8/JAN have not been addressed in v36. ====== doc/src/sgml/ref/create_publication.sgml EXCEPT TABLE 2. + + For partitioned tables, only the root partitioned table may be specified + in EXCEPT TABLE. Doing so excludes the root table and + all of its partitions from replication, regardless of the value of + publish_via_partition_root. The optional + * has no effect for partitioned tables. + 2a. AFAIK, the 'publish_via_partition_root' value has nothing to do with EXCEPT(partition) in this patch, but why was it really necessary to actually say that? ~ 2b. Should this be saying that "ONLY" also does not mean anything when a partitioned table is specified? ====== src/backend/catalog/pg_publication.c publication_add_relation: 3. + /* + * Handle the case where a partition is excluded by EXCEPT TABLE + */ + if (pub->alltables && pri->except && targetrel->rd_rel->relispartition) + ereport(ERROR, + (errmsg("partition \"%s\" cannot be excluded using EXCEPT TABLE", + RelationGetRelationName(targetrel)))); Should we have a hintmsg here to ask/tell the user that they might need to try EXCEPT the partitioned root instead? ====== src/backend/commands/tablecmds.c ATExecAttachPartition: 4. + /* Check if the partiton is part of EXCEPT list of any publication */ + GetRelationPublications(RelationGetRelid(attachrel), NULL, &except_pubids); + if (except_pubids != NIL) + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot attach relation \"%s\" as partition because it is part of EXCEPT list in publication", + RelationGetRelationName(attachrel)))); Maybe reword the message SUGGESTION ... because it is named in a publication EXCEPT TABLE list ====== src/backend/utils/cache/relcache.c RelationBuildPublicationDesc: 5. + /* + * Only the topmost ancestor of a partitioned table can be specified + * in EXCEPT TABLES clause of a FOR ALL TABLES publication. So fetch + * the publications excluding the topmost ancestor only. + */ + GetRelationPublications(llast_oid(ancestors), NULL, &exceptpuboids); + I found that "So fetch..." sentence to be quite ambiguous. SUGGESTION ... , so we only need to check the topmost ancestor. ====== .../t/037_rep_changes_except_table.pl 6. + ALTER TABLE sch1.t1 ATTACH PARTITION sch1.part2 FOR VALUES FROM (101) TO (200); Was there any reason to do this ALTER? AFAIK, you could've said both PARTITION BY and PARTITION OF in the original CREATE TABLE. ~~~ 7. +# Partititions cannot be excluded using EXCEPT TABLE 7a. typo: /Partititions/Partitions/ ~ 7b. TBH, I don't know if it was necessary to repeat these partition tests all the time with/without publish_via_partition_root set, but if you still think it is needed, then the comment should say that all combinations are tested to demonstrate that the parameter has no effect. Meanwhile, the same goes for all the other tests too ... Given that 'publish_via_partition_root' has no impact on EXCEPT TABLE, then why do we need so many combinations of tests to show that it has no effect? IOW, many other parameters also have nothing to do with EXCEPT TABLE, but we don't test those. ~~~ 8. +# Cannot attach partition that is part of EXCEPT list in publication SUGGESTION Cannot attach a partition that is named in the EXCEPT list of any publication ====== Kind Regards, Peter Smith. Fujitsu Australia