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.94.2) (envelope-from ) id 1vELm1-00Ad9b-Vm for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Oct 2025 06:04:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vELlz-006DlQ-Rs for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Oct 2025 06:04:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vELlz-006DlH-Dz for pgsql-hackers@lists.postgresql.org; Thu, 30 Oct 2025 06:04:34 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vELlw-004VxA-1l for pgsql-hackers@lists.postgresql.org; Thu, 30 Oct 2025 06:04:33 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4e88ed3a132so8336151cf.0 for ; Wed, 29 Oct 2025 23:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761804271; x=1762409071; 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=o5puffzzzIO3Td/z33AR780a2WrnEN/SWtUM4E1hUI0=; b=g3/9/7yLhtq1kdO8HfL9ydYwUEq2eqIgUtnzAAbERFk4dwxp0z/9GStckcYBdHYef0 MeY2NaiDJiiG8CPAuLer03McxZJHUicZyR3AhV2d4mBDh40c1USimn4/PPZ5r7bTzGkR OSi3xWbiWuNcbiJ4jz0fDFJkX5qq2HM6MDqjIyi6rFWj25roXgaxIxc3B1EltVyEWzR9 FcISyLq5emIfdEYAcmQfX7TBuGBarlNAeUs+FyvFzhtsPasAjJ48dBVE1yeUtzjNUm34 4kDicOntWQFYgFUmDLDVqXHzk9xv7iEA0m+E7TAhMKiIezrzlBrypzBvwNB16gW0e9Fo u88g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761804271; x=1762409071; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o5puffzzzIO3Td/z33AR780a2WrnEN/SWtUM4E1hUI0=; b=tbXQLgpngVRF3wFCiNrLv3yk2v+mSinHbdmFxKgpknvsTC8KHY2B01HUJtI4MNLnXz uPGG/5g+/ziYgI3Yo8+K53PY2d038yJOzQ5DjiRzeliYEuyDrYGSK9/96F6A7weujNth cLrAMid4Ebu/fgbASVKMI7hlaDEPjwDxTFGAlSqEvtyZRM9BxTgpWXxexgYDn6n2cyRs VtoLhP0x5rXUdhWH8Hck8wLCNQ+dL3SQ2W8xvULv/GsHkK6tcok1WOlQ53KyXgs5eOEy 7po7X8jweavNsCya1N4KKfG3P1deVUx5usFStw5UmEdZAULELQMIMpMs6iws4ijV8Bho 59lg== X-Forwarded-Encrypted: i=1; AJvYcCV/5D6ZDywutJkyaQ6Kl5ZnDLuGZsisD6/dkzeZgtwsWvitd2KRRX1Q/MeQ8YpoGOtlJzQJjeWcsnnzm3hc@lists.postgresql.org X-Gm-Message-State: AOJu0Ywzxg8LJusjj0WZ2QMW4OeaJPgg9ktY7wsJ+Spab+vP7YZauxlW 2J0SJlhTvVUXQ+4tIUcgyclcUJ2Yke7Q2uqEZNKBQKMMjpHFcouJgJtDqwpLknO5TrWhyJXBvBD uBivRJVQmqOmzWGDTKU159/24dWOO8ek= X-Gm-Gg: ASbGncs3Li5P+flrArBw4r6qvHdSj86wQRu8oYW5OWwsraUTzxwrJ4glqDyakUFjk5G N2K9/vEjkC0ZJTIBrPy36EGYbEXinjyq4l7l5AFVFRYN9rLf7KDt2joA93YG9ah6sgD9V8QU75Z JsF7/mMTjJFD+l3yX0BC3IdNQuQRp3tAPNV5KtsNKkZlyL+hBWOrQ3vHMNoJKJY2RpXLziQYi5J 90JKhSsiy5U+CmXVLTwnvuP2Cea7r7okMwZzSLj8Y8WT5mhZzheWmy7yCeDb/gHfJzB42qnb02a PLwRFN8U4h7d9co= X-Google-Smtp-Source: AGHT+IFehpPTdmVDVWiiDGxLabUfRjeVHOW7WmzSmLd3/Bw0APcn5LSXVDwNEWjRl83xCNCJArwtE5H0+WrG7LTZ+1Y= X-Received: by 2002:ac8:5a55:0:b0:4eb:a457:394 with SMTP id d75a77b69052e-4ed217faeb8mr26300851cf.12.1761804271535; Wed, 29 Oct 2025 23:04:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Thu, 30 Oct 2025 17:04:05 +1100 X-Gm-Features: AWmQ_bkA8corG_Fh3v0V_sPa1Blb-QtDbxTl-eADegHUogf7Sj1IUHzihBOZqcw Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal 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 Hi Vignesh Here are some review comments for the patch v24-0002. These comments are just for the SGML docs. The patch needs a rebase so I was unable to review the code. ====== Commit message 1. A new column "prexcept" is added to table "pg_publication_rel", to maintain the relations that the user wants to exclude from the publications. ~ /to maintain/to flag/ ====== doc/src/sgml/logical-replication.sgml 2. - To add tables to a publication, the user must have ownership rights on the - table. To add all tables in schema to a publication, the user must be a - superuser. To create a publication that publishes all tables or all tables in - schema automatically, the user must be a superuser. + To create a publication using FOR ALL TABLES or FOR ALL TABLES IN SCHEMA, + the user must be a superuser. To add ALL TABLES or ALL TABLES IN SCHEMA to a + publication, the user must be a superuser. To add tables to a publication, + the user must have ownership rights on the table. Those "FOR ALL TABLES" etc are missing SGML markup. ====== doc/src/sgml/ref/alter_publication.sgml 3. +ALTER PUBLICATION name ADD ALL TABLES [ EXCEPT [ TABLE ] exception_object [, ... ] ] and + +where exception_object is: + + [ ONLY ] table_name [ * ] + It is not clear from the syntax which of these is possible. ... ADD ALL TABLES EXCEPT TABLE t1,t2,t3 ... ADD ALL TABLES EXCEPT TABLE t1, TABLE t2, TABLES t3 IMO it is best put the "[TABLE]" within the exception_object: [ TABLE ] [ ONLY ] table_name [ * ] Then both are possible, which is consistent with how "FOR TABLE" syntax works. Furthermore, you might want later to say EXCLUDE SEQUENCE, so doing it this way makes that possible. ~~~ 4. - Adding a table to a publication additionally requires owning that table. - The ADD TABLES IN SCHEMA, + Adding a table to or excluding a table from a publication additionally + requires owning that table. The ADD ALL TABLES, This wording seems a bit awkward. How are re-phrasing like: SUGGESTION Adding or excluding a table from a publication requires ownership of that table. ~~~ 5. - name to explicitly indicate that descendant tables are included. + name to explicitly indicate that descendant tables are affected. For + partitioned tables, ONLY donot have any effect. typo: /donot/does not/ ====== doc/src/sgml/ref/create_publication.sgml 6. - [ FOR ALL TABLES + [ FOR ALL TABLES [ EXCEPT [ TABLE ] exception_object [, ... ] ] | FOR publication_object [, ... ] ] [ WITH ( publication_parameter [= value] [, ... ] ) ] @@ -30,6 +30,10 @@ CREATE PUBLICATION name TABLE [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ] + +where exception_object is: + + [ ONLY ] table_name [ * ] Same review comment as #3 before. I think it is clearer (and more flexible) to change the exception_object to include [TABLE]. [ TABLE ] [ ONLY ] table_name [ * ] It also helps pave the way for any future EXCLUDE SEQUENCE feature. ~~~ 7. + + This clause specifies a list of tables to be excluded from the + publication. It can only be used with FOR ALL TABLES. + If ONLY is specified before the table name, only + that table is excluded from the publication. If ONLY is + not specified, the table and all its descendant tables (if any) are + excluded. Optionally, * can be specified after the + table name to explicitly indicate that descendant tables are excluded. + This does not apply to a partitioned table, however. The partitioned + table or its partitions are excluded from the publication based on the + parameter publish_via_partition_root. + + + When publish_via_partition_root is set to + true, specifying a root partitioned table in + EXCEPT TABLE excludes it and all its partitions from + replication. Specifying a leaf partition has no effect, as its changes are + still replicated via the root partitioned table. When + publish_via_partition_root is set to + false, specifying a partitioned table or non-leaf + partition has no effect, as changes are replicated via the leaf + partitions. Specifying a leaf partition excludes only that partition from + replication. + I felt that the second paragraph should be started with the sentence "The partitioned table or its partitions are excluded...", so then everything related to "publish_via_partition_root" is kept together. ~~~ 8. + + Create a publication that publishes all changes in all the tables except for + the changes of users and + departments: + +CREATE PUBLICATION mypublication FOR ALL TABLES EXCEPT users, departments; + + The words "the changes of" are not needed, and you did not use that wording in the ALTER PUBLICATION example. ====== doc/src/sgml/ref/psql-ref.sgml 9. If x is appended to the command name, the results are displayed in expanded mode. - If + is appended to the command name, the tables and - schemas associated with each publication are shown as well. + If + is appended to the command name, the tables, + excluded tables and schemas associated with each publication are shown as + well. /excluded tables and schemas/excluded tables, and schemas/ ====== Kind Regards, Peter Smith. Fujitsu Australia