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 1vT1qZ-00Bgv9-0P for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 17:49:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT1qX-005zqi-2U for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 17:49:58 +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 1vT1qX-005zqY-1T for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 17:49:57 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT1qM-0045LJ-2w for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 17:49:57 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-450063be247so2672034b6e.2 for ; Tue, 09 Dec 2025 09:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765302585; x=1765907385; 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=KUZLa4Mhc3dciG5LapkXJURBd+0o1FD4EaJ0RmYJ9Hg=; b=eRVJkVwIsKGeAQHz5GzqS3ZP+bUJ1MkVOOzmqLgWsIUMX4cVKPgzYuLcFEGfK+jSy/ k+H0g9gg7tHR0GigN2oMRW/V7ISIEd3id5tdHBkACW9cYwwoSnvNd4jqLgGgIiLmWaQC gDQve3IyPe6ptIbLXx4FtDVBJv+a1r0bDj348jewYWWh/YoD4u/s/2rNv73cqWAYfsKp kT24OTWStQbFkefY/K3T9+hlhcJ1LbtpydFNABbFr4gt+EZaCNdawCz+tnQybapJhcd4 3CqOQj7qwZKBiK/0/hQ4qfpXDjFqmyLfNNzGPx1dJVRh6Mbfy5z1DFYCAG/aJ9f6pf9B wtcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765302585; x=1765907385; 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=KUZLa4Mhc3dciG5LapkXJURBd+0o1FD4EaJ0RmYJ9Hg=; b=WRZYemTrgAfsJ+egbfJ9Pg73dR4y50YFijnPAktsxLK8EsM8rLUxvtfck5X7A/a3kN Aoq+Nw/jq/B4bP15KKx8eh98p1HYmtOWdc2UPt6QmZv0Olzc94rY4cezCadV5a7kwO5p G1oKgmTIzOPWZ128HeUDUu3JKQuTefchA1W14+rtTvhS8QnPD//at8T3TaGAAAFPgiQo 4wqIvHdpdNdxeQlViSYd2cONvW3MIezIZrheaa4NyTBPBtNRXGWA4rZbZM52LIxmgiLd eSnQ9dJDjljfKHkmg2b7F8J3qot8zKROVkeIFuNbPuV91ibsLAy6twpovM1q3TzzijEq L4jg== X-Forwarded-Encrypted: i=1; AJvYcCVuRNdu7VXfbmSsvrxeOjod/b2UtXTk4JcGWWSditJM/Gw2zl2qPjwCdnDcVlhpJkSfkDY7e32dIxRMBx0I@lists.postgresql.org X-Gm-Message-State: AOJu0YwNVEOlbffesFFgLNhZ6/vRhBRYpdVv77ivFKkTkeWLsoiO7usq c4ErZxPF02gkbHJU6bX/ie4no3myLjKtH6hSLcUkGYLdvWg/eKW+/DqXUn27bDf3HSSTZ2ZVNw5 nnktAuv+IUcX586wuNhnB+ycFQSzbt3w= X-Gm-Gg: ASbGnctpbFLSZtlmges2X+vIY2d2NIqtqwKn1CJ0oTN2Pu4DDyatFKb0SH7y/aamZTu sOfal2bue7ykQ4K4hdHI3i+bhnebMx0gnmG2MEKvoetmP/5moUAuX+tole5GlSU+G2RMK2H8Dz8 QgDsSO4HGWYc6qahAati5si53HWd8nRgP59FGd9DGUbMp7bOWc54PvS2psr4CkaRgbYsAilDa2L ZUvxKJyzx3LizGz+hfA+OFab6o5BfN7koj9zpE7FetSieUoD5MguW61HgDgfX5xUxFfqtVt1A== X-Google-Smtp-Source: AGHT+IH8yWhtmrKna2/hx4Aqi8bt5yZdqU6Tbul5BYWHHjdN20NcNf8SaoLgZaU7JqIiKxI6dQcEKfzKUSS3AhtAoWk= X-Received: by 2002:a05:6808:2f09:b0:453:7cb1:871d with SMTP id 5614622812f47-4539e0f9c4amr4394567b6e.52.1765302585064; Tue, 09 Dec 2025 09:49:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Shlok Kyal Date: Tue, 9 Dec 2025 23:19:26 +0530 X-Gm-Features: AQt7F2ovsZ8-8exiMmjE9rQwTv5m7yKHXGTfZhmPETM7yO5bCyI330sOnuhwoR0 Message-ID: Subject: Re: Skipping schema changes in publication To: Peter Smith Cc: vignesh C , Amit Kapila , "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 On Fri, 21 Nov 2025 at 12:26, Peter Smith wrote: > > Hi Shlok. > > Here are some review comments for your patch v28-0003 (EXCEPT TABLE ...). > > The review of this patch is a WIP. In this post I only looked at the test code. > > ====== > .../t/037_rep_changes_except_table.pl > > 1. > + > +# Copyright (c) 2021-2025, PostgreSQL Global Development Group > + > +# Logical replication tests for except table publications > > Use uppercase: /except table/EXCEPT TABLE/ > > ~~~ > > 2. > There are lots of test cases dedicated to partiion-table testing. I > felt a bigger comment separating these major groups might be helpful. > > Something like: > > -- ============================================ > -- EXCEPT TABLE test cases for normal tables > -- ============================================ > > and > > -- ============================================ > -- EXCEPT TABLE test cases for partition tables > -- ============================================ > > ~~~ > > 3. > +# Initialize publisher node > ... > +# Create subscriber node > > Those 2 comments should be almost alike -- e.g. both should say > "Initialize" or both should say "Create". > > ~~~ > > 4. > +# Test replication with publications created using FOR ALL TABLES EXCEPT TABLE > +# clause. > +# Create schemas and tables on publisher > +$node_publisher->safe_psql( > + 'postgres', qq( > + CREATE SCHEMA sch1; > + CREATE TABLE sch1.tab1 AS SELECT generate_series(1,10) AS a; > + CREATE TABLE public.tab1(a int); > +)); > + > > That first sentence ("Test replication with ...") is not needed here. > The is just repeating the purpose of the entire file, so that comment > can replace the one at the top of this file. > > ~~~ > > 5. > +# Insert some data and verify that inserted data is not replicated > > Be explicit that we are referring to the excluded table. > > SUGGESTION (e.g.) > Verify that data inserted to the excluded table is not replcated. > > ~~~ > > 6. > +# Alter publication to exclude data changes in public.tab1 and verify that > +# subscriber does not get the changed data for this table. > +$node_publisher->safe_psql( > + 'postgres', qq( > + ALTER PUBLICATION tap_pub_schema RESET; > + ALTER PUBLICATION tap_pub_schema ADD ALL TABLES EXCEPT TABLE > (sch1.tab1, public.tab1); > + INSERT INTO public.tab1 VALUES(generate_series(1,10)); > +)); > +$node_publisher->wait_for_catchup('tap_sub_schema'); > + > > It is not strictly needed for these tests, but do you think it makes > more sense to also do an ALTER SUBSCRIPTION ... REFRESH PUBLICATION; > whenever you change the publications? > > ~~~ > > 7. > +# cleanup > +$node_publisher->safe_psql('postgres', "DROP PUBLICATION tap_pub_schema"); > +$node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION tap_sub_schema"); > + > + > > double-blank lines. > > ~~~ > > 8. > I think it would be more helpful if the partition table test cases say > (in their comments) a lot more about the steps they are doing, and > what they expect the result to be. Sure, I can read all the code to > figure it out for each case, but it is better to know the test > intentions/expectations then verify they are doing the right thing. > > ~~~ > > 9. > + CREATE TABLE sch1.t1(a int) PARTITION BY RANGE(a); > + CREATE TABLE sch1.part1 PARTITION OF sch1.t1 FOR VALUES FROM (0) TO (5); > > Maybe create this table to have *multiple* partitions. It might be > interesting later to see what happens when you try to EXCEPT only one > of the partitions. > I have addressed all the comments Please find the updated patch in [1]. [1]: https://www.postgresql.org/message-id/CANhcyEXwLrQsec6g%2B1dqWTKyJQMQMh%3Dgetj28C%2BzLL14BjuumA%40mail.gmail.com Thanks, Shlok Kyal