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 1viRLY-006J57-0p for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:05:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viRLX-0051U4-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:05:39 +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 1viRLW-0051Tv-2J for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:05:39 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viRLV-001fDs-02 for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:05:38 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-59b6f59c4f5so7104413e87.3 for ; Tue, 20 Jan 2026 22:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768975536; cv=none; d=google.com; s=arc-20240605; b=ee5VPHA31YaVl+YSZiQxa+8hj/7swiHn0KvjXonCFjJcIq0Npk+BsBQWwdq90wj8L0 Vwz9dlqqPhNQepo/jVdW6NZ7uFgOtvSy1AOpVhnLoqWqmKwDVx/BOOJlVcrLVpHbry3l l9llDwGdt0vvBePJwWI3w6hkIAIqyPXtCv0nomp45TJHATuKcc80+kDKAqPe0ePDumf1 N6e+sfeJRkgaizc/k4urglc54qVGfRSfMrJawdOjYpU1k5F6oMqDBE9jSxQtAOsuK9hq 2zPumUuMpJiNl9ovtXO1q8y4aQu1dy+fhubqJ3TE1TMTR3SowpNNt7CUZ5LHcAcjBJxc kF4g== 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=1rAJE/kRifXMeR0wGFAJa9VYmeUEgQWbe4leN22HLS0=; fh=SKnAue3LdIGvqXltEXGoYW4LUppLckObCIFkLQ/aeMY=; b=hftoyd1s/kux7OKTJVoIAsjFg1rOFWCItE8MYq+du20iiW/VdFkJ+Wetq384NZsO1S VhPOTFKhzZmMMfxoW0LnuMIumapxXR9Ay28A6VWlUcHBeXgq1g9dCi9GhjNY5VTsLy1d 903tqgMWWRNVu37ivfZeJY6yG7bfiUVqFoeICNmog4A+T3Ge87l8R2//A5X13JlzRzMB MDJz3Qm32ThPAWCnm7WZ6Fk2sQaNI6EqPHD+8a5nvaWsHpP/xOoBGuaaqmjY9w11ZdTM nn9u0gU0vFM8puO2LdR6nfhLtR+16BgFoUgXbMlmlcSNHU1XnFtg9i66gUrKnWmRwypd N6bg==; 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=1768975536; x=1769580336; 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=1rAJE/kRifXMeR0wGFAJa9VYmeUEgQWbe4leN22HLS0=; b=VdswR1nzWO/5d80/XxDADycaHHkz1cs18dqLKymUXMCf8YuuOrD1ZZlbE5ewS23GAM 3qie2gwNOu3uCjZEnqyIdH1otjElPp5ukA9RUyj/zGKoRiMjjJJ62lXR8jnWY/ccnm/P Jic1q7V4bbCirYLkUVJdsA0jr4McoiRR+RQeTynEtrPXiBG0Ki+afmHWBt+8Mfa01FT0 9amowuVQdcc2pFE4/qFP0KTkTGiXcbPzBfTnkXj5n7cCuOwUQWhpTfqMDzC5z3zTGmWE vQzI2PD/tu5C0dK5SrlKYw/VcbORkMwvDrSM55HRUBJwQZJdMBu4g092ArUV2v44Ww/J AGMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768975536; x=1769580336; 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=1rAJE/kRifXMeR0wGFAJa9VYmeUEgQWbe4leN22HLS0=; b=FEj/uNcBqOALADEVLoYEIb8V9kB0T01zKnC/vbQDYdp+W1zaBb8lsZbRt/N/XvTwoJ JWfhe1YZNKGZe57HiSVMprKaqYDiY+G/hy3lazMCQt+wrLskDYVN4yVEaJSOhaNjqemD HFrwtU1J1wMa9oofK8pnDrnLlq1PDJasoFjJxn5qOQgt4VvCr/O0ooqedCHIvekKUX4u Tt7vYybWXDZ4VvxJUh2Ue5DrHOS4MZw8oRhTG0BxbEijiCvS1aqnAY5mE2x2aTL286Sq kQKd8uICVMQ7VWbpzgFauZtg3gr0Nitikj3t44zTMQIO2yPiE1fGN7gsOW50ZAKjL83m SUsg== X-Forwarded-Encrypted: i=1; AJvYcCX78SKcHJUF1rJpZlG+im5n0cz245pNX47DkhVUHROi2jNsQlUDsKuNpSI/ckZGIWfHm6Tbs2+JxeIoyEeX@lists.postgresql.org X-Gm-Message-State: AOJu0Yx9AZCLvHsMONIjz/cpc/k3a8gP1zJYQzeLFGRX2Mw0et/d5Pre u9EopQ6azxuCMYnR1VztpBG2noAntVLYZoG2StVRFUzKCldCIiKRf1Uu4yVxCmwZ16GgBnfuMIP oyTjUsNp9qf+UXxyMpOLo9hboVJmTu+Y= X-Gm-Gg: AZuq6aKdnljTOqFoVPHdpYJF5KgEXwVpEg1ZeNosD9e1cCoGvfLX+DwPMfiXJnOzYFP OBF+P5rDPiVvKFkXNxpRveIfi92KdTo4RmP3/FCK1c5QDU2hmvU6tvl4Ya8SVzNpu0QfXE2iTt0 Q/wetEwaWs7YNnPUJJkdATrxc8lxFTetVg7izxFXQvySFp0SpCiNckM1T61vtxc/0fRZM+jLZXi cpcWoAK6IAC581GnY4F/d5K2fmJuC2NsKE/0pT9jZO/ttDSeIJ3EsdrS8NcY+J3u8Ib69c= X-Received: by 2002:a05:6512:b0d:b0:59b:71f4:3de9 with SMTP id 2adb3069b0e04-59baef00149mr5579969e87.39.1768975535507; Tue, 20 Jan 2026 22:05:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dilip Kumar Date: Wed, 21 Jan 2026 11:35:18 +0530 X-Gm-Features: AZwV_QiTVWgpqIlTSdr7elJrJhP0Kked4wORegsJkfq598aVysFI6pj8UeqgoLw Message-ID: Subject: Re: Skipping schema changes in publication To: shveta malik Cc: Amit Kapila , Shlok Kyal , Peter Smith , vignesh C , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers 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 Mon, Jan 19, 2026 at 3:08=E2=80=AFPM shveta malik wrote: > > Approaches for Supporting EXCEPT in Partitioned Tables > ------------------------------------------------------------------------ > > In an offline discussion with Peter Smith, Amit, and Shlok, we > identified several approaches for supporting EXCEPT with partitioned > tables and their partitions. I=E2=80=99d like to hear others=E2=80=99 opi= nions on > these approaches. > > Consider the following partition hierarchy: > tab_root > =E2=94=9C=E2=94=80 tab_part_1 > =E2=94=82 =E2=94=9C=E2=94=80 tab_part_1_p1 > =E2=94=82 =E2=94=94=E2=94=80 tab_part_1_p2 > =E2=94=94=E2=94=80 tab_part_2 > =E2=94=9C=E2=94=80 tab_part_2_p1 > =E2=94=94=E2=94=80 tab_part_2_p2 > > > Approach 1: > --------------------------------- > If we exclude a table, then the data in that table and all of its > partitions (i.e., the entire subtree under that table) should not be > replicated. > > For example EXCEPT (tab_part_1) skips replication of tab_part_1 and > all of its partitions. > > This behaviour remains the same with or without > publish_via_partition_root. The publish_via_partition_root flag only > affects publish_via_relid, i.e., the relation through which data is > published. > > This approach involves certain implementation challenges. For brevity, > these are documented in the attached 'Approach1_challenges' document. > > Approach 2: > --------------------------------------------------- > Assign meaning to ONLY and '*' for partition tables in the EXCEPT > list. In HEAD, ONLY and '*' do not have any meaning for partitioned > tables or partitions, and these keywords are currently ignored. > > Examples: > 1. EXCEPT (ONLY tab_part_1) skips replication of only the table > tab_part_1. Changes for tab_root, tab_part_1_p1, and tab_part_1_p2 are > still replicated. > > ii. EXCEPT (tab_part_1*) skips replication of tables tab_part_1, > tab_part_1_p1, and tab_part_1_p2 > > The challenges described in Approach 1, particularly around tablesync > handling and COPY behaviour, would still need to be addressed under > this approach as well. ONLY or '*' with partitioned tables is not > supported in HEAD, supporting it specifically for ALL TABLES EXCEPT > may introduce additional confusion for users. > > Approach 3: > ---------------- > Do not allow partitions to be specified in the EXCEPT clause. > > Only EXCEPT (tab_root) is supported, which excludes tab_root and all > of its partitions. Specifying EXCEPT (tab_part_1) or EXCEPT > (tab_part_1_p1) will result in an error. > > ~~ > > While Approach 1 and Approach 2 offer more flexibility to the user > compared to Approach 3, they also introduce additional design > complexity which does not seem simpler to address. Thanks for explaining this, overall I like the Approach 1, and I also see the problem when publish via root is given in that case COPY FROM is executed on the root and it would be hard to exclude specific partitions. What is the behavior when root of partition tree is added but publish via root is not true, it doesn't add any relation to publication rel or how does it manage to not copy data from partitions? --=20 Regards, Dilip Kumar Google