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 1w23TR-000q7B-1g for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 08:38: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 1w23TP-008Us8-3A for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 08:38:52 +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 1w23TP-008Us0-27 for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 08:38:52 +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 1w23TN-00000000OSW-3s1m for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 08:38:52 +0000 Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-5090c7e9081so39052771cf.0 for ; Mon, 16 Mar 2026 01:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773650328; cv=none; d=google.com; s=arc-20240605; b=kFOTZRTMeLVCm+dRF4xFu6IqDOv86IPEPFIvT8bflrg0yqHnRf8B+AgWYJzNjfsmiR 5nfjyvm5iy3Qhot7BuGZ/fJB2kP+iP2XInBWzJpb4b45ZV28xSZ5GrnAieUhous/9WvY HhvO6r9CmGy+ApOpd9qIeVp54weRYbdsxYAdh84/f7JgQHA9kQNqtkNaUqtEXEaW64T8 VgWn6KVwpNLV61QhzKASoh/yOpzwf/DhXuz2CN2ntX63tSj2xqunhNpyaby/wV6JBwMk zPlsRXEgmO8qNkn+hhkYBff/lBGpuq7vQYo9q6ORArAkL8jkQd8mrcfPGjntbuiWiNee iOKw== 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=SB20+Hx+zo6l3yhPitb064yLZWhMEufTBUws/ulpMW4=; fh=+en/OcMuVXrEBBQjFSAT+HcmIsfxHQWj1ovTxGYODpQ=; b=WSJbVkxj4QrX9BA8jtHaks4gKNjUiwX20CNTmtD3h0aALbwnnDVFUIpze8SLitl/51 3NlrVJp1+IymzP3d6xkvlUpvIupVipghk0yiC9nleeaXGEuZu09Jmk2BhXYUdHHp+mY2 Zvc1c8+sjfRwe+zn9g2Y0h2LcfZv8lYCmW+HpoHV0lcwZoHYTgzBr5AuJrop9S8KYi6A SS3GzcmnxEAjkCT0LD2HZGhHlfOIKW77GWyx3F4buZgsdrKtgV12zcDmtLrcDO8WNPS3 ENWzV4XlVkVB0Z3h6/ODjS/35mhfmhxO2lMCRZet32Ar4xRUROsYXh3eP5zNmgYe8kk0 YwAw==; 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=1773650328; x=1774255128; 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=SB20+Hx+zo6l3yhPitb064yLZWhMEufTBUws/ulpMW4=; b=lB8w1BNEx71vOFm+dQUBJKIwQZJ7OY6bs3fKzI2e2dQD1p6xecmsy/Gnm372IvHJcT 5FCEAu9XcgBKD2MIyiToHS3LJK9oqQ8b8uTN7i0SM6mG7Rom0wNKUN94Pw77wqvQnIeq rsukh+M3OUMTWWBDxl37AdoXGRQmqq1fd9o2mV1EnBm/Ni+wXG7P5xmDQgRr4FkNVYqf iIVnYZWiQIh+S8prmFDQ3t1rsGEJ98UBaAp7mtOMP1nJoUMHOKTX/a650egwA7Odlx0o /7k2lmabCSWmplMFuR/sjr72KDlmHDNKWMDNeXd0U5JT69K9NefiVULe0yfyUXe73GsR WpLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773650328; x=1774255128; 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=SB20+Hx+zo6l3yhPitb064yLZWhMEufTBUws/ulpMW4=; b=Qo8XgduB/fgoRA4615wJGBIRkiz3fjNbN4kiXY7kyww+fgBcojY+PrKzsxmOBA46ay UldsBfG75sXvR1PWyl6VSacFVy9zXbOVehIYiSOswqgXYD7S2zAdRdmkxrncwmyUUeSK t+k4gHpTbGaUzDKrVVf+D3w7Jd3e05NLVlX1sHZKQHZINM5qjuZx6DdUFLoIG9IjYoek MHFSAnYLz5QT1AWpM3GqI6c/7411EC/ABPI3xb/4mJ0jlHmeEqSadCobkck/rt1T6wOk Was1uqqeMa8LYRBvELLclWyj3iFvnWFBZswLKoEbvfHZoHfoLmALs7b+ftv0Gz1Y76TY ynVA== X-Forwarded-Encrypted: i=1; AJvYcCUP2SVk6qTBGoUnQkVeEWTXrJGgtZGWm2smNU9fth5iF4s4UdERO6/EtBC9kouur5vKEUaqwp7509jKUiVV@lists.postgresql.org X-Gm-Message-State: AOJu0YxsQNJGse21LvLXd4OnHx/LTQ4p2h5DA6mz95ze1jCe3adEVfYh C9k6xE451rf1Pk6U44fE158yIca1PMYE9P2yYBnME0aB7RGKJmB4r4fI6WDyZGoEX8q8sOlCkVc 4T0J2Ae6CRaEbkMSd4OwRJ2uQV3YbDws= X-Gm-Gg: ATEYQzxE6ugq2wkpVo2qdy7OAekEx3C3xMoAuW6eKbdSgsUI90EHNVygwapJL64BkoF Svx72fOxw/cWwXezdV/H5UYvJsxVbuIIOOBCdqw6ZRcvMNT7iAO96DTOiK0dotFwHwdis0d5yV3 XfqZ3cc9dzcqhnc+xkqySp0g/KtFWuLZQuxCV6iVTnZvHNV2icwjrl8e8CRyfpZ8/7Sfa/ncH5d z0PxD0uM6QZC6VdMF82IgkrF5SQ/IJAno8MgvUtGiWikIrKznpdxlXmeA0JutpEOQkjchqytr6R zMtNQCM= X-Received: by 2002:ac8:7f13:0:b0:509:23ee:b9b2 with SMTP id d75a77b69052e-50957e252a4mr155631671cf.44.1773650328376; Mon, 16 Mar 2026 01:38:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Mon, 16 Mar 2026 19:38:21 +1100 X-Gm-Features: AaiRm51ps9Q1PUv2Sgmu9-6fMsFycB0AxM1Z_ArFckBI2c6cHWJAEEadt41V8Ww Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: Amit Kapila , Masahiko Sawada , "Hayato Kuroda (Fujitsu)" , shveta malik , Shlok Kyal , Nisha Moond , Ashutosh Sharma , "David G. Johnston" , Dilip Kumar , "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 Vignesh. Unfortunately, IMO there are some fundamental problems here due to there being no accounting for publications with FOR ALL SEQUENCES. So I am posting my review comments for just the docs part so you can see it from my PoV. Maybe this was already discussed earlier in the thread but I saw no mentions of it. AFAICT the discussion/posts were mostly focussed on the setting/resetting of EXCEPT TABLE but seem to be overlooking the bigger picture. Below review comments are for v63-0001 docs only. ====== Commit Message 1. The first form replaces the current EXCEPT TABLE list with the specified tables. The second form clears the existing except table list. Like the creation syntax, only root partitioned tables can be specified in the exclusion list. ~ IMO the second form is a long-time missing command from Postgres. For example, it is possible to create an "empty" publication. But without this "ALTER PUBLICATION name SET ALL TABLES" there was no way to convert that to be a "FOR ALL TABLES" publication. So really this feature was independently needed and should be done anyway irrespective of any side-effect it has for the EXCEPT TABLE list. Ideally the SET/ADD/DROP ALL TABLES can split out and done ahead of the EXCEPT TABLE stuff. Similarly, SET/ADD/DROP should be implemented also for FOR ALL SEQUENCES otherwise there is no way to manipulate those either. ====== doc/src/sgml/ref/alter_publication.sgml 2. Implementing the "SET ALL TABLES" is only a start. You also need to have the other case: * ADD ALL TABLES * DROP ALL TABLES Note you might start out with something like "CREATE PUBLICATION pub FOR ALL TABLES, FOR ALL SEQUENCES" so you need to be able to be able to modify/remove the published TABLES part without overwriting published SEQUENCES part!! i.e The "SET" means set the publication; it doesn't mean add to the publication. So SET ALL TABLES obliterates any FOR ALL SEQUENCES. ~~~ 3. +where publication_except_tables is: + + [ EXCEPT TABLE ( [ ONLY ] table_name [, ... ] ) ] + Hmm. Ideally, this should be part of 'publication_object' and publication_drop_object' because the ADD/DROP are also needed for the reasons given in my above review commentS. ~~~ 4. - The first three variants change which tables/schemas are part of the - publication. The SET clause will replace the list of - tables/schemas in the publication with the specified list; the existing - tables/schemas that were present in the publication will be removed. The + The first four variants modify which tables/schemas are included in the + publication, or which tables are excluded from it. The + SET ALL TABLES clause is used to update the + EXCEPT TABLE list of a FOR ALL TABLES + publication. If EXCEPT TABLE is specified with a list of + tables, the existing except table list is replaced with the specified tables. + If EXCEPT TABLE is omitted, the existing except table + list is cleared. The SET clause, when used with a + publication defined with FOR TABLE or + FOR TABLES IN SCHEMA, replaces the list of tables/schemas + in the publication with the specified list; the existing tables or schemas + that were present in the publication will be removed. The I find this all a bit dubious because nothing seems to be accounting for the possibility of "FOR ALL SEQUENCES" also in the publication... e.g this entire ALTER command should also have SET ALL SEQUENCES ADD ALL SEQUENCES DROP ALL SEQUENCE and SET ALL TABLES ADD ALL TABLES DROP ALL TABLES IMO, a user will need to take care when using ALTER PUBLICATION ... SET ALL TABLES that it does not destroy the publication of sequences (and vice versa) -- Start with an "empty" publication and make it a "FOR ALL TABLES" publication... CREATE PUBLICATION pub; ALTER PUBLICATION pub SET ALL TABLES; -- result is equivalent to "CREATE PUBLICATION ... FOR ALL TABLES" -- give some table exceptions to it ALTER PUBLICATION pub SET ALL TABLES EXCEPT TABLE(t1,t2); -- result is equivalent to "CREATE PUBLICATION ... FOR ALL TABLES EXCEPT TABLE(t1,t2)" -- add sequences to this ALTER PUBLICATION pub ADD ALL SEQUENCES -- result is equivalent to "CREATE PUBLICATION ... FOR ALL TABLES EXCEPT TABLE(t1,t2), FOR ALL SEQUENCES" -- remove the table exception -- here you cannot simply use SET ALL TABLES because you will lose the ALL SEQUENCES part of the publication!! -- So, instead you need to do like below ALTER PUBLICATION pub DROP ALL TABLES; ALTER PUBLICATION pub ADD ALL TABLES; -- result is equivalent to "CREATE PUBLICATION ... FOR ALL TABLES, FOR ALL SEQUENCES" ~~~ 5. + + + + Replace the publication's EXCEPT table list: /EXCEPT table list/EXCEPT TABLE list/ ~~~ 6. + + Change the publication to include all tables by removing any existing + EXCEPT table list: The clearing of the EXCEPT TABLES is more like a side-effect, so I think this can be worded differently. SUGGESTION Reset the publication to be a FOR ALL TABLES publication with no excluded tables. ====== Kind Regards, Peter Smith. Fujitsu Australia