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 1vlkYY-003TCQ-25 for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 09:12:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vlkYV-003tcQ-2L for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 09:12:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vlkYV-003tcI-17 for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 09:12:44 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vlkYT-0008MZ-1y for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 09:12:43 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2a743050256so11393245ad.3 for ; Fri, 30 Jan 2026 01:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769764361; cv=none; d=google.com; s=arc-20240605; b=PssvRQv7XYmyuiKJWZqdVZbAM/i1tVAAy6KHCU5ZM4UcgvgDcH7wzfb3gfCoYp0iEz bm1AnLPAL+o+2x2mdEAMUWzRIFdy2Fi4yKy4QdqhPcJqt38xUA6L1zlBeBxGRlOfgtTn zsHGdHTzL8L6/acaA4luJDMqUH4cAwNbag8XMV8zJruEvr4MHhQBZsMXs0w/avb1riaT 9GZv3Ns6YDKuQldkGbLAyCHT/syP/oDPlWVtZibVuFM4YAv0bGAOL/o6IqTJn5BglQb+ Zgn26vmo8jT9L5EyOrKyK/78Bmfkb0qZSL/NG6ovCJf09LfTqw5aofjLop18kpM+jTqG BlCg== 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=yzLg6JRuHTq4Bs9Vne+7zXWwv3joXkDIy5vvGRkp7FM=; fh=9LAMhf6AK4iOUuF3du4BeqSkMIRNSDVtF0L6Vb1v0iA=; b=RHUx7EFRvKKqMJkP6wzxpQO4c6NMYPMsgTR1d2pGvnBGcrHF2vkuwjoqkVofXxJI4o GLn2k2AJ5+CpzNRmHpoPV3gtXKzVHZZDJhkgMvcdCz1Jfi1+8qGzP/Ff+imWfvP6KWoj 1m/OipQhHKLaXLbluSXWPrS7c4jubX+Gi2rnQhwI0jsXqMiOIjSYMMPyVtRwzCRfhihj K2BAPlBrbwKnkF7cN8YYBFGZ0Dciga2QvQFxIIAKQeaNu7UFBi76VUC8ALqmm5T9C7MT 6fpZApyxigJzVypgn/dFTwDn6jEP8AwdApp9gZAMcYmERKyKYiWqSV1P5GmhoK+rHQtd p9UQ==; 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=1769764361; x=1770369161; 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=yzLg6JRuHTq4Bs9Vne+7zXWwv3joXkDIy5vvGRkp7FM=; b=TZGePmuKN+RdH49pQOPsjQav0rgSvtCvBFHAmwoocK2VDUC8oN/6sLnxv33UXF9lwR yerv9+gBzCUpemz4cAyLr0NKyu7nK7P4yagnNE63ljzkC9lej2gxNYj+EMka2RRMcete XZ90GXyLdl0PkpjKg73UkFgyH90YYMFTvS2ttxER5Mmc99fvd+x46KAUWEMMjdn/SKg2 B7AdSvOgT5Eu95Mh6Q/80Y0Rv7YnGRjPqLjWmACDYAAyuM1lPOgjGHquAeRJC9/Qw5HH mXKeE+p5ohW5YgLiY+c8iTbFwOBKTAtErWL+L+g+bGtxZVb/YDBB67BOonX6ZK2dzqas nLyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769764361; x=1770369161; 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=yzLg6JRuHTq4Bs9Vne+7zXWwv3joXkDIy5vvGRkp7FM=; b=G+rBuaoo7AoviPmddJB3O+xJvJ/K+h7VjWhUPwyNWJq6JGbzVJe+GuiBYugTZb8lN6 YbsqydWPMZXpz8KPpnIeR7+aWT5tBO3Wd6vC4MiuLPmQvd8jkB/5GsHXp/RUnaicwDWM DgVj0CKfq/Yt0Le7YMRThj+3MlfTA5PNNMRM2B4LLUkB7+0817rTxvW5tl+1gi5eSN8M MFQelxtqFN7gKs/y/3xQ50PW/FIrkG+3v+1NSfr9Dwsjvrr4rg4VglJpOIMbCSN0tmcI n9Z9HPqec7i3ViASZESYcfqpkQa9YkzokNfDM61nTh+yt3YoJo5JDaIVQzhKBpNGKEyT j4hg== X-Forwarded-Encrypted: i=1; AJvYcCWpB2HinJ8IMBQS9XUw/LELnhkY5dhU90RT83/S2gZCWYDG9U070Q1W3zRSEet00/mW/cwa+cvZyTCpGepW@lists.postgresql.org X-Gm-Message-State: AOJu0YxyXobpl1VRB3YkdkBM1hkkq5iYMEuLrvgjamAE55rkWYTfq/vq ymtNrYlVqBH76vhRnWUKfRpttE1xtv9g+GTr2qEyR2y/K9zqE7RTV9/wScWlgRGIr5NCvIQmz9m gBSOQTYsbyysOyeR2dImXm9kOnfrQZyY= X-Gm-Gg: AZuq6aIc/rsEMtniuArmb65XtuRQV4PhwPjr/RhKyR9XIuv/pViTljPJor9++4jo8w4 TTP8QQGKabxxdNXN/oT+WMpCTGeSgPVD6MIuQUVGz16O+bUSBIEbBZzjjEgEMowazHjaZ/HbE5T cEiL6WdYhQLWl+728SwmYJkc1zMHXhkc/6aqds3YhzSpVJeKxeczUOrja7tZVtWOKB5a9la6yOO RvEE1uOpWZ9dAoTJpNzM+o6XM+JJgDA1uVxD64ORtLuo7VMRB1ILEaBC6xIkem2SKHhcqAA8Ak6 FhNKvJ/EXb84SxIAcqObo45pB+FMI/OdA5DFbF6W X-Received: by 2002:a17:90b:56ce:b0:341:ae23:85fd with SMTP id 98e67ed59e1d1-3543b315807mr2124028a91.11.1769764361145; Fri, 30 Jan 2026 01:12:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Fri, 30 Jan 2026 14:42:29 +0530 X-Gm-Features: AZwV_QjNq2ZdQMEw82UwtCiBwUOUbR7Kz1YtvU691s9UuxeBpjY9yVoxnUoaSBQ Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: Dilip Kumar , Amit Kapila , Shlok Kyal , Peter Smith , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 29, 2026 at 8:41=E2=80=AFPM vignesh C wro= te: > > On Wed, 28 Jan 2026 at 10:46, shveta malik wrote= : > > > > Thank You for the patch. > > > > 1) > > There are certain parts of Approach 3 still present in Approach 1, as > > an example: > > > > 1a) > > + For partitioned tables, only the root partitioned table may be s= pecified > > + in EXCEPT TABLE. > > > > 1b) > > + /* > > + * 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); > > + > > > > 1c) > > + /* Check if the partiton is part of EXCEPT list of any publication */ > > + GetRelationPublications(RelationGetRelid(attachrel), NULL, &except_pu= bids); > > + if (except_pubids !=3D 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)))); > > + > > > > Overall, please take a diff of v35 and v37 to find such parts and > > please correct these and others (if any). > > > > 2) > > Also I don't think if below is correct statement for Approach 1: > > > > + * 2. For a partition, if the topmost ancestor is part of > > + * the EXCEPT TABLE list, we don't publish it. > > > > Even if any ancestor is part of EXECPT list (not only top most) we > > should not publish that partition, isn't it? > > > > 3) > > I tried a scenario and found that incremental replication is not > > working correctly. Attached the failing test as Approach1_v37_fail.txt > > > > Once these basic things are corrected, I can review further. > > These comments are addressed in the v38 version patch attached. > Currently the approach-3 changes is present separately in > v38-0002-Restrict-EXCEPT-TABLE-to-root-partitioned-tables-apporach-3.patc= h > which can be applied on top of > v38-0001-Skip-publishing-the-tables-specified-in-EXCEPT-T.patch. > Similarly the approach-1 changes is present separately in > v38-0002-handle-EXCEPT-TABLE-correctly-with-partitioned-approach-1.patch > which can be applied on top of > v38-0001-Skip-publishing-the-tables-specified-in-EXCEPT-T.patch. > Currently few of the query are logged as LOG messages, I will reduce > the log level for these queries once few rounds of review are > completed on the queries. > I was trying to test Approach 1 and haven=E2=80=99t fully reviewed or validated it yet. A few initial observations: postgres=3D# CREATE PUBLICATION pub1 for all tables EXCEPT(tab_part_1,tab_part_2_p2) WITH (PUBLISH_VIA_PARTITION_ROOT=3Dtrue); WARNING: partition "tab_part_1" might be replicated as publish_via_partition_root is "true" WARNING: partition "tab_part_2_p2" might be replicated as publish_via_partition_root is "true" CREATE PUBLICATION postgres=3D# CREATE PUBLICATION pub1 for all tables EXCEPT(tab_part_1,tab_part_2_p2) WITH (PUBLISH_VIA_PARTITION_ROOT=3Dfalse); WARNING: partitioned table "tab_part_1" might be replicated as publish_via_partition_root is "false" CREATE PUBLICATION IIUC, these Warnings are not expected in Approach1. thanks Shveta