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 1vdhWW-003e7i-0L for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jan 2026 04:21:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdhWU-00HUpq-37 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jan 2026 04:21:23 +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 1vdhWU-00HUpi-1z for pgsql-hackers@lists.postgresql.org; Thu, 08 Jan 2026 04:21:23 +0000 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vdhWS-005CxC-2U for pgsql-hackers@lists.postgresql.org; Thu, 08 Jan 2026 04:21:22 +0000 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-4f1b212ba25so23263311cf.2 for ; Wed, 07 Jan 2026 20:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767846079; x=1768450879; 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=wlxjfOowlP5qwkyanm+D+ugIx1jFYswuTY8FgtVD5hE=; b=d2Ocir2C1eZfIdyhhM15BOJfMZT8i7obzDBSASdZxG0Onl2a5Alwn9XXLorp1STm0P SpySXT7HCLQ+bLQx1xhwS1IdDvFsgRRtnVRzuQKSXBuvT9SUw/mT1sHaeiioI+rOIlHn 9eGcP+Hb+mB3fe5qoXIwQu7/e1KJGH6IQKveTiECdiV048JYXZkE0UtqOvJqdAtGepHc 99qHwwDi4IQytl7Lsgx0L12YoGcuEywkWpkvKo2nbBIZ3fjtopS+5sJGd8WQqVTjrtCZ jX9bGbBR6IKjecDkCSYiWssD+VJ6IQHCMFUIprxOvJjloyGIiiIg/YVLuMPiYsqceb/C bZ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767846079; x=1768450879; 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=wlxjfOowlP5qwkyanm+D+ugIx1jFYswuTY8FgtVD5hE=; b=W8BWFPLD0j45Vv/gB7q1DudOqMpW1gzsoqxMKzW9pwZPthlR1SaQGll9IIATPoRYKc XNxKewjbt+n03TrWn8+N2mn36BV1eLlgWM2TGtL+TU8jhOaXBnlB/8hUnTdEl+wz1Gln 1GNq0gtkiU5am3xTaFRi5gFSII0ghhtq7JooVXhPceTcf4j8gEdBtuWW1bFa/WTs/FIX 7N0RVN0WRG1i0HzJGdpjw1pog7DYqjBhnLdkxfk/wrfCuX9pqCbErpdgrgAtj7vcMQGD QMx8naJ8z93lpRIJCjjGSFVcO0qGgNWg5bSucjn+bRsWdAAkm1X5rC0bbQAFhFojHB7m 6cXg== X-Forwarded-Encrypted: i=1; AJvYcCWp5lctV49kHhD3z4brHWhvyA1o0KWFZPsJkMKlZyjY72oDKnOVogdw5O4h12h+jG00n6BtE8xXsLtS4+2+@lists.postgresql.org X-Gm-Message-State: AOJu0YxXI+RGxvD5hrd5XQHWB13FCGb24UHQy7qTnjyRqinMXPWrGudL KxxhRAikSf3VA9BvfCAH8PiTxE0fwncZtcrDKdQ8q7+Q6AYOHa+s0ovbI4RBCW1CtkHQvDQPlYh v/G1XEs1xfKHCXfKrTgT84EHw+i909ds= X-Gm-Gg: AY/fxX5EGb7XgHp8nz+wmaBaKlmEpSeo4DeLkMBCKLL49vbwc6ouQwxQqRzDRB7RlSF lnJm9TEWeK8TdNO/PKG3eLTtaHYhcxA82futEcNBHYAQrdy5Cq0XUkIdwSQHbnhwP6BhlfK2keT VGpaRK8CS4NwHBu3+LHeOucMj9k5OxZys7vZHK4l17c16Wnyd0dhGy8/3rbRBY0QKi2ROW1Cqmn lfFIt4wJ4eIZ6pWtvinsiV43WzNGJVdtbcHVF4vNwXilMEtUyPxvIrpU3oQ1lM39jNjjtq8aQJz /FFxiLn8cAAc7OXUHgKMqdxxBV1Y X-Google-Smtp-Source: AGHT+IEmvzocp19f11DLRNI+7PeCMaMAMdL/XJD5jOFU6B2hXCBtkDwa3HCEMGKaV7OddWmJTq42NDH0gf9sDiqYEbE= X-Received: by 2002:ac8:7dc8:0:b0:4f1:e284:d42a with SMTP id d75a77b69052e-4ffb49e6a63mr59464171cf.43.1767846078989; Wed, 07 Jan 2026 20:21:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Thu, 8 Jan 2026 15:20:51 +1100 X-Gm-Features: AQt7F2o9jRY5c_ZWjT-cKhrEyZxxne3Mal43ppeLkgXNLbRCKMcf_3I2ekN9JvY Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: shveta malik , Amit Kapila , vignesh C , "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. Some review comments for the v35-0001 patch (code) ====== src/backend/replication/pgoutput/pgoutput.c get_rel_sync_entry: 1. /* * If this is a FOR ALL TABLES publication, pick the partition * root and set the ancestor level accordingly. + * + * If this is a FOR ALL TABLES publication and it has an EXCEPT + * TABLE list: + * + * 1. If pubviaroot is set and the relation is a partition, check + * whether the partition root is included in the EXCEPT TABLE + * list. If so, do not publish the change. + * + * 2. If pubviaroot is not set, check whether the relation itself + * is included in the EXCEPT TABLE list. If so, do not publish the + * change. + * + * This is achieved by keeping the variable "publish" set to + * false. And eventually, entry->pubactions will remain all false + * for this publication. */ For that last para ("This is achieved by..."), it is unclear what "This" is referring to. I think you mean like below: SUGGESTION Note - "do not publish the change" is achieved by... ====== src/bin/pg_dump/pg_dump.c getPublications: 2. + ntbls = PQntuples(res_tbls); + if (ntbls == 0) + continue; + + for (int j = 0; j < ntbls; j++) + { + Oid prrelid; + TableInfo *tbinfo; + + prrelid = atooid(PQgetvalue(res_tbls, j, 0)); + + tbinfo = findTableByOid(prrelid); + if (tbinfo == NULL) + continue; + + simple_ptr_list_append(&pubinfo[i].except_tables, tbinfo); + } + + PQclear(res_tbls); 2a. That first condition with 'continue' looks like it would be better just to remove it. Otherwise, the PQclear(res_tbls) may leak. Anyway, the loop will never iterate if ntbls is 0, so where is the harm in removing this? ~ 2b. Also, that "if (tbinfo == NULL)" seems overkill because it is only avoiding the final statement of the loop. It might be better to replace this like below: if (tblinfo != NULL) simple_ptr_list_append(...); ~~~ dumpPublication: 3. + appendPQExpBuffer(query, "ONLY %s", fmtQualifiedDumpable(tbinfo)); I think that unconditionally choosing "ONLY" here may not be the right thing to do, particularly when the excluded table is a partitioned table. (e.g. this is related to off-list discussions about how to EXCEPT partition tables). ====== Kind Regards, Peter Smith. Fujitsu Australia