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 1wes7S-0055yY-1Z for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jul 2026 10:24:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wes7R-00D09S-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Jul 2026 10:24:37 +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 1wes7Q-00D09K-2X for pgsql-hackers@lists.postgresql.org; Wed, 01 Jul 2026 10:24:36 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wes7O-00000001B1g-1a6U for pgsql-hackers@lists.postgresql.org; Wed, 01 Jul 2026 10:24:36 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2c9b125d64cso2650405ad.1 for ; Wed, 01 Jul 2026 03:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782901472; cv=none; d=google.com; s=arc-20260327; b=Y+mhDPU60gTDYbpeevXFaObEj2tySQyi0eVf8w9E+WUmw9oKe4ddYn5BC0DXawNCnk Xc2VNuQG6mfyV7qXKaphpIACF9sO0/IW4n4+0tu05rxtIfvy8wM3vBlGd6AEQp2XooxR KiB3+PgS/Il/XN9Zdn6yjTqmSNsBAHb3i5fkhO3FbqDcQA6YgC0GKdNouo7MIeKnXNis 40H3KJn1IMboAWkkMSenPRsw4wBJjOCb4Drd11DBaI2stcjzkySEzS8zbfB5sJfLKuST oYZIFggXzOjXHVxqkclwXQF7blBfwPr5A1QBz1eR/jA8vQsYnlQRT3FSbe6AzwttKMm8 53kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EjEp/hjPubynKxde+rLP1DJMtyk5ZdNLhvlgJUXdww0=; fh=nnx7UIkiLTEXG4kuxFaQ4bHBZhO+jAV26Z8JwPqWl/U=; b=dNT02Y9PwPF/n9SaCHczmOVGsWpFij1tl5EfDgyWy+gEgnLxXZOXtRmgVL1xzN89D1 YB26t466OWCN5z4/RGk7RzU409t+nKAxeeKvUKQMDskuaYrix9LWdxl68CIh0WIC6VC8 AZPabjwZj7IaGaLilEO8p2G655CpUSAJhcz9+mkOiu6d1iQNgjC/MVl++knD40P3fizB fhk3xSceWh+O3IbJkhD2WvbSL6CabRUy9LJIOJJzh7ggjYbawDX5u/Ss+UaxS9OOugQZ D3DPsq0MS20NW7qsTISLx5sFOUleBDFLAM6sVbXqc9/UB6eKrcfjnBG6hamxV1lsVKRU pnuw==; 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=20251104; t=1782901472; x=1783506272; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=EjEp/hjPubynKxde+rLP1DJMtyk5ZdNLhvlgJUXdww0=; b=j5rlwEj/eOCVijG+v8k8H8Gxzdymhp/odzLLLABWVceNYerkFlX119cifFaJS+jUMX 3Lw77wCYScCIiwtT5tEO4kYpqC0vtOZf8zrlpsxznniDq2cQyOqf7ENxksWVfMXQ+1X+ Dw1Dqw8Iyv5OGr8zyCPxclAt1owhbJfT4k17RgpbI0SB4VxRC8sPxDk4/7rpBK4+Yge2 KuIsSh6QISvC3fQx81CxrxYk7SsecyUrLZEuvuzI0KGqJVht4vP1CZH7J/Mj8HdBWvOt EFOw+hIlmUntbf9rcKTbOIlYt5RIcESrTb7MGq082omYmCIiYEU/9jYMI/QUqQqWbAJM tqFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782901472; x=1783506272; h=content-transfer-encoding:content-type: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 :content-type; bh=EjEp/hjPubynKxde+rLP1DJMtyk5ZdNLhvlgJUXdww0=; b=hcKlmfhJj6HFDYqtLBNiQL8sSxzJn3vup/6yZs+jzArDODWzbRNDUbFW2AHcX6cxPl jWRDcHQA0KYA8S2C1EFgbhbBwJi4L1OlItUdzwTYLK9rkHiC7TwYr/cn0ZeVPKi8D2sG Vh+79UwzcvyHJXcGaKlYeqrWFwEaLT8jzu9ZHZvKOpeiS8tBYFN1FL8xmfrLnU7HYCgl SeRfZyVj8VkvB1Cju0SRfzLgJHYQ7QJxbtPVMZr5RY9YBh+j90vXdZZznA/LnHondlGY QpyzDSr/x/QZsPBN5mVDVBX38dgZ/4+c26zemhdEi6A6TTgD8+tKZDAjCa8bQLhUxV8M 307A== X-Forwarded-Encrypted: i=1; AHgh+Rq0mDoUeCfkz5KDC05M6ocs/LYsYuQnMFkWRhXXw2vA4oUlt+vFgHPDfF7DYKB9tx3AcqVdc1HM3X1pTp1t@lists.postgresql.org X-Gm-Message-State: AOJu0YxzIr7l2PUtxN7YRLLDM3/nBeia/Is5e/qdvwSYGn3LIM2vl+JY qz16ioAWcdt+aZ+ErDUtk2xPfT2JimQtqnLxeG5I5j7klcjk8PpE+Qgrr7TOAcWYstlsAjvTzaq Cuobj52kXC/AGATyJkmrVuUvnrNo8RLs= X-Gm-Gg: AfdE7cmnHIv/tSk1HgT/lMpY+NtgdVWhFhNNVsxAxUKWCLi3ejROjKF+nsAM3lU9B+P dVVFQE+pVVjI3zMfBUb5iLdDtaJkS7Z+LSPteapcdOnFNLNSouhOn5IKE654KEeeL3FhUtYiHgh 1ACGcO+UFYVCt8Ke8WLEfUQUMjmwDj090G/K9AknA2k+j/PIA5jH9y5lwlyAFc7mlXXlj3aaZKN az3mUtHMJiE6J0AsjSw/ohmXUJ+oD2zzdhqYFHK+yY7/ISPX5o4spQ0YFS2zgvyFaWj3dhY0iqv ctdu8jT5FTctcmFO6QcCNmDAEu/0LjgLslIvxE1LEA== X-Received: by 2002:a17:902:c411:b0:2c9:8f4a:90b with SMTP id d9443c01a7336-2ca7e684b78mr11205955ad.3.1782901471791; Wed, 01 Jul 2026 03:24:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 1 Jul 2026 15:54:19 +0530 X-Gm-Features: AVVi8CfAjbEBuh33nc3YHq8HTAA6yf6Elxh6MPaENeNlrw4f6dFhCJgMoCg3bGQ Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Nisha Moond Cc: Peter Smith , Amit Kapila , Zsolt Parragi , pgsql-hackers@lists.postgresql.org, 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 Wed, Jul 1, 2026 at 3:42=E2=80=AFPM Nisha Moond wrote: > > During tests, I found one behavior that needs discussion: > > Consider a partition hierarchy where the root table is in schema s2, a > child partition is in schema s1, and the publication includes both > schemas but excludes only the root table. This is the exact scenario I had in mind when reviewing 'get_rel_sync_entry-->GetTopMostAncestorInPublication' flow, thus I suggested adding comments about intentionally fetching the 'Exclude list' only for the Root. I was about to test it in my next review cycle. The first thought is that if root is excluded, the partition should also be excluded to maintain consistency with the 'ALL TABLES Except ROOT' behaviour. But then it needs to be documented too. This is my initial understanding, but I will think more when I resume the review. > Test case: > -- Root of the partition tree lives in s2 > CREATE TABLE s2.parent (id int) PARTITION BY LIST (id); > > -- Child partition lives in s1 > CREATE TABLE s1.part PARTITION OF s2.parent FOR VALUES IN (1, 2, 3); > > -- Publication covers BOTH schemas, but EXCEPTs only s2.parent > CREATE PUBLICATION p FOR TABLES IN SCHEMA s1, TABLES IN SCHEMA s2 > EXCEPT (TABLE s2.parent); > > Currently, if the root is excluded, all child partitions are also > excluded, meaning s1.part is not published. However, s1 never excluded > 'part' explicitly, so the behavior may not be intuitive. > > We need to decide whether child partitions should always remain > excluded when the root is excluded (regardless of schema), or whether > schema membership should still allow publication. > > I've added an XXX comment in pg_publication.c to track this until we > conclude on the expected behavior. Suggestions are welcome. > > -- > Thanks, > Nisha