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 1w72QB-004tm1-02 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 02:32:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w72Q9-000ZgQ-0e for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2026 02:32:05 +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 1w72Q8-000ZgC-2n for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 02:32:05 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w72Q6-00000001v3Y-21S4 for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2026 02:32:04 +0000 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-506a747448dso32507651cf.0 for ; Sun, 29 Mar 2026 19:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774837921; cv=none; d=google.com; s=arc-20240605; b=MnbNVskpQNcDs934W58CnUCUeoRwN9T2Il1mHBIgIheNUpx8KOSX0/VZO7YLVy9WjR JzXgZ601kKJFZqAIT0/F4QOTnsjE2LSbH7Vog9WpCRmKwI2RPmSLOj0O0dOIiSZc9crS wmE59IR6vzYD8eax90C5Pijpf7kjEjoZrIappF5ZOoZlDP8FW7e+O2AvO9QZet6LYBSk vGBw+mpoceCRPeHkypT9RrqpkfO0DiOm0rmIW4FZrPgJRuejlO8bleht9bFW91eCWpEZ yAYnHxh0ctGSgqbJZ0IBaEcHWvauRQwbyFcIQsoc8wi9nR4Z3+Y0VliaBeY1YKY1atSl GPEQ== 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=9fP6YVJG0ciO7En5rnJ2zHIkbB29vGqSFW4GI+sJZnw=; fh=MiYIzRxfHO8qKGozuTbg48NaN3l2b+GJkSru0FOEwAs=; b=RrbjAB8aDJsc52gFlWoMSEG7qLPXqvkTi9w54TLLcqr7I6LeLO8jmxUtCuA6lGSoBJ 0DmPw2zcnapbp/CyktatJYPt6MjGNsaAfe4X9OWLN18Gt1pyyPu7NgzD9GT9Dcv3DTJT s7TcPRO1FbIWq6GR6fTGWMnBIfNf08u+B/da1L+Oltw/flrETtdpevn55ALkiO15HEBC PMTaq+FoPACF5MmjPB/MGV5EI5Clhn0rRGFgktv5UVCD3DqwdbmaUwp+jE8homdhVhXu Ba+Y0xlSW9gPhyiDOAVVY1uPNiPwW2oQNLs0bfC6YP9LLS8X+pzq4QkfXXFpwZyD2jxl ltRg==; 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=1774837921; x=1775442721; 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=9fP6YVJG0ciO7En5rnJ2zHIkbB29vGqSFW4GI+sJZnw=; b=eKhj+OOKg9ixpQichLJ8mutUzlqZpezVMZQ0h+xKRqPEkIY3QoUbyUwsvW1oagFnjs NGos4pxh3JZio1TQ6BLdfFyIdMUzINMLqHM6wNuqqXq1yBfSG45qvaFiUBGL+cBIOp70 fpDtzqu6/nG7SBns+RMYU/w3+5wy3dts9g2XUf5+I9QgTOsyQ+AKnQ+DO/emENhDk+x7 n5LwmSV8ozFWk15CU8jlMxkUsiHCOghdeHXf+qAkLqt4buY4M8TBzOyrfnNAg6Y5aNkJ o/UVHY0bHorqHaJq4wb7Y0pTpZmGhiD6lCu6mZVOzJ+b2x1YlP2MkRViS8veG10ZVxqh zdiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774837921; x=1775442721; 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=9fP6YVJG0ciO7En5rnJ2zHIkbB29vGqSFW4GI+sJZnw=; b=Vrc540W6eP+XIuzsbjKtSRxudVZj/ZK1qNf6mq3IBNLzP6j7bF1zVxLcQnI4UyPM0z Gy2ok1OI0ncNSfVHA/+rfPfPCMzn5nIqCpcBX6rjbvPFALSbLd/H6XfFrVNH+Qqup3+f cwdvgyaI0yYNcGOjqhyVPdSpJDMeqQljC6K94cIQNyxT4D0A7K98NNz7HXZgWWatlNpr YUmP65peOCSFg9b5R4yQkmM9CqbtuQ4x17jOpE9z80TAF5n370mubWmm6gwUzyl1BmAT bG4anP33S58/KhL5EFfpvFZfy3jDKinj/HfIIfw1VVQ1lnuBHAEd0K8ERSAscUPcmNcq eP/Q== X-Forwarded-Encrypted: i=1; AJvYcCV5dFAQvkHGZ5p3Jer/P7jpp5PuIf4/j/xZxDz5ePWB4jXMjy00qv1EqmizDZu/+L8Lex4NudrhetLP/RM1@lists.postgresql.org X-Gm-Message-State: AOJu0YxAFZ+tgJzTxZBEq3mfEq19DzUEYG1iXSxxquD8LFXWs4KvldGq Kgw7c6D7je5CPQVg9FxjRtUG6rW1gD4od6OYJmVBDWTsLXWi8Sxq7MfrG+542yDnKrbLvWFJnjd X8fyGUrVeVGNCqrlSnlyKoAO6DVt6oqo= X-Gm-Gg: ATEYQzzkmtR4T8Lmyj74NRv7tBdUdsZvBlGc22lek+FF5AXZgYevLCEwWa4swGhkpFI kjB6h9BDJHI4nP+tbn8lePAiql8njQvvMtPNUaZQiffo1qz6Qe6f6QhZNJLdc37sDwfwi9r14u2 NkIJVcBrw/3/Po1DcVgs4Z3d4WkIHCc7XRPBovIxKtC/vD8OVWr9biClxyjiTaMYOCRbAcngkrS e658QyI3fFjY6afRsjUGaTYvERiH5XoMiLvJtIA+XIFeYvej+1/sNEpl/jQmMKzk8wA2qEEEnxT QhzsxcxFT1qW8Zy0d0qAUys7ywUhA0EpunW+Ys48pA== X-Received: by 2002:ac8:7d04:0:b0:509:20de:4acc with SMTP id d75a77b69052e-50ba38b218emr151733981cf.47.1774837921273; Sun, 29 Mar 2026 19:32:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Mon, 30 Mar 2026 13:31:33 +1100 X-Gm-Features: AQROBzCtlD8IIdacmIQWlRFzNL44weu93GobLFZiDGbVIz4jq-g1o44IIHvFY-g Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: Amit Kapila , vignesh C , Dilip Kumar , shveta malik , Masahiko Sawada , "Hayato Kuroda (Fujitsu)" , Nisha Moond , Ashutosh Sharma , "David G. Johnston" , "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 Shlok. Here are some review comments for the patch v3-0001. (not yet reviewed the test code) ====== doc/src/sgml/ref/alter_publication.sgml synopsis: 1. - [ ONLY ] table_name [ * ] + TABLE [ ONLY ] table_name [ * ] This is still not correct because it is missing the ellipsis that is needed within 'except_table_object'. e.g, the currently documented synopsis would not permit FOR ALL TABLE EXCEPT (TABLE t1,t2,t3); You might describe that using one of these ways: i) TABLE { [ ONLY ] table_name [ * ] } [, ...] ii) TABLE [ ONLY ] table_name [ * ] [, ...] iii) TABLE table [,...] and table is: [ ONLY ] table_name [ * ] ====== doc/src/sgml/ref/create_publication.sgml synopsis: 2. Same synopsis problem as described in the above review comment. It is missing the ellipsis that is needed within 'except_table_object'. ~~~ EXCEPT: 3. - EXCEPT TABLE + EXCEPT The 'EXCEPT' clause is not really at the same level as all the other ones, because it can only be applied to the FOR ALL TABLES. So, I felt maybe 'EXCEPT' might make more sense as a sublist entry under the FOR ALL TABLES clause. Moving this would also eliminate some of the current repetition: e.g. "Tables listed in EXCEPT clause are excluded from the publication." e.g. "This clause specifies a list of tables to be excluded from the publication." ====== src/backend/catalog/pg_publication.c GetAllPublicationRelations: 4. - * in EXCEPT TABLE clause. + * in EXCEPT clause. /in EXCEPT clause/in the EXCEPT clause/ ====== src/backend/parser/gram.y 5. static void preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner); +static void preprocess_except_pubobj_list(List *pubexceptobjspec_list, + core_yyscan_t yyscanner); The new function and the parameter names do not match as they do in the existing function. e.g. Should this new function instead be called 'preprocess_pubexceptobj_list'? ~~~ preprocess_except_pubobj_list: 6. + ListCell *cell; + PublicationObjSpec *pubobj; Why is this function referring to PublicationObjSpec instead of PublicationExceptObjSpec. Is it correct? ~~~ 7. + if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION) + ereport(ERROR, + errcode(ERRCODE_SYNTAX_ERROR), + errmsg("invalid publication object list"), + errdetail("TABLE must be specified before a standalone table."), + parser_errposition(pubobj->location)); If this was intended to mimic code from the existing function, then I felt it should say "standalone table name." instead of "standalone table.". ====== src/bin/pg_dump/pg_dump.c 8. if (++n_except == 1) - appendPQExpBufferStr(query, " EXCEPT TABLE ("); + appendPQExpBufferStr(query, " EXCEPT (TABLE "); else - appendPQExpBufferStr(query, ", "); + appendPQExpBufferStr(query, ", TABLE "); You don't need the TABLE keyword in 2 places like that. SUGGESTION if (++n_except == 1) appendPQExpBufferStr(query, " EXCEPT ("); else appendPQExpBufferStr(query, ", "); appendPQExpBuffer(query, "TABLE ONLY %s", fmtQualifiedDumpable(tbinfo)); ====== src/bin/pg_dump/t/002_pg_dump.pl 9. 'CREATE PUBLICATION pub10' => { create_order => 92, create_sql => - 'CREATE PUBLICATION pub10 FOR ALL TABLES EXCEPT TABLE (dump_test.test_inheritance_parent);', + 'CREATE PUBLICATION pub10 FOR ALL TABLES EXCEPT (TABLE dump_test.test_inheritance_parent);', regexp => qr/^ - \QCREATE PUBLICATION pub10 FOR ALL TABLES EXCEPT TABLE (ONLY dump_test.test_inheritance_parent, ONLY dump_test.test_inheritance_child) WITH (publish = 'insert, update, delete, truncate');\E + \QCREATE PUBLICATION pub10 FOR ALL TABLES EXCEPT (TABLE ONLY dump_test.test_inheritance_parent, TABLE ONLY dump_test.test_inheritance_child) WITH (publish = 'insert, update, delete, truncate');\E /xm, like => { %full_runs, section_post_data => 1, }, (Maybe this question is unrelated to the current patch.) Why is the expected result explicitly including ONLY children like that instead of saying "EXCEPT (TABLE dump_test.test_inheritance_parent *)"? ====== src/bin/psql/tab-complete.in.c 10. - else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "EXCEPT", "TABLE", "(", MatchAnyN) && ends_with(prev_wd, ',')) + else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "EXCEPT", "(", "TABLE", MatchAnyN) && ends_with(prev_wd, ',')) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables); - else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "EXCEPT", "TABLE", "(", MatchAnyN) && !ends_with(prev_wd, ',')) + else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "EXCEPT", "(", "TABLE", MatchAnyN) && !ends_with(prev_wd, ',')) COMPLETE_WITH(")"); The CREATE PUBLICATION seems to have tab-completion logic for the ',' separator and closing ')'. But I did not see any similar tab-completion logic for the EXCEPT clause in ALTER PUBLICATION. Is this maybe another issue independent of this patch? ====== src/test/regress/expected/publication.out src/test/regress/sql/publication.sql src/test/subscription/t/037_except.pl (I will review these later) ====== GENERAL 11. The file src/backend/commands/publicationcmds.c still refers to "(EXCEPT TABLES)". ====== Kind Regards, Peter Smith. Fujitsu Australia