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 1vt1PB-00FgaD-2j for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 10:37:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vt1PA-003FP9-1h for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 10:37:08 +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.96) (envelope-from ) id 1vt1P9-003FP1-2y for pgsql-hackers@lists.postgresql.org; Thu, 19 Feb 2026 10:37:08 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vt1P6-000000007Tv-2VBT for pgsql-hackers@lists.postgresql.org; Thu, 19 Feb 2026 10:37:07 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-387097ae2e3so7376521fa.2 for ; Thu, 19 Feb 2026 02:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771497419; cv=none; d=google.com; s=arc-20240605; b=GO0XMhLxZhuFRWkLDEBe1W0etgrzetWIxp1thdmbr8bgNjVCSvfimU44dGU2isNOFT 7u5pKuZ9JVtqxYTn0aUaT9UN1pODEV57miPUHbpZEfUmez+vVIHT/LZMDHIxiJCQCehr Vx4YpC2O/O1IMEl7i/bNT9aoopet7eF+4hNq/zuJJp1hEM1txNLJ8H8IuyLYkPcHt1WO f/NkBPcFYnWazyDE1hRKNcuriKc8yx1IO69ZY4SQfm9Kh8kKSnYoFwjneJDarvLSmTLQ RLn682kMH4LbvmHYL3WI68wfBR6n9y/ymVGcRRd1BkwUxEaz5n6Judl733mFWwSQ/AZH abQg== 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=y4h35OaAj1V7qB7c3YZcmGh11tZCP8Y8yt+oT5n9RSg=; fh=u8ezjXbw+WaF2rwkiFyNz/cuhrDtAhVdlTDVzAxhGsY=; b=Qq5h2CsTMFRE+unXxk2tqJykySo9iutQsW1Tk3bBVtPwJEs4OZtNLXv+W57OuPvF+a 96nrOQ725qmaaZ+T0Y4mn5fAFbOVd4rzsowtK2xG1MWSCKFfXBDIX102aHibHsbl6+rK Ufx9SfRO5TenbVhhxFIxcEBNDnruU8SAa3DJojb4jNCusok1Fo6Q2YaxFLWrWupW33U0 nMlGUAIB2oTUDXcgfRJ87FjPCH77RezLXmvTPpC/nGOviF+nDNCSCI6b3yGzdfDNm/2A QcAidr6LoL0/E7atSrbW61k2iGyzLDTSCgKX90LXzema422s5fTPPYeWb2MHqHdnq8Xk 51mQ==; 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=1771497419; x=1772102219; 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=y4h35OaAj1V7qB7c3YZcmGh11tZCP8Y8yt+oT5n9RSg=; b=Z6aICUjoFXYtSm8oufnTV6tcgab5xcc7GYVA5Gn7rVLQd2yCunghoF2qrfk37gXKqK teuZWAm4NiiOHc8m44Nr/u8MRyo+49uw1H1PGj5VBtonYC1Qt7+SZUZ31ow+mjiP4sJY z0zoi8KYFpMDcVTRF4VQYvrL9T7BSZT/X5PsQZJfjVYFLUFTw9QPqFhfs43q6LBeC2nE bwF4BUlguSrxK2Rhgt7uVLAlM09+JtfUXY1orAW+0B264bhng5W7MP80TldFk+l/A0QS +QBXI9uOgohvgCuHv91y1e808OxpQQcO2lndm61blLpX5tuMmc+crNQpHNYz5H4Y6JPQ SEGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771497419; x=1772102219; 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=y4h35OaAj1V7qB7c3YZcmGh11tZCP8Y8yt+oT5n9RSg=; b=aF+EmfLtPlisKARdL9vLXyTKbHvYjnLrms6xhXXXPpe1AJsZD8YuMUKRzNBI76gu2o AjeZHPSN8LQq+rd2X8agc1YqMagt3sjSBE5/ZN3PGSO9E8/TgG5oN8gjB0Alfd6Mez8/ Yj8hpi36PLpr4ci9j7vUDA5Vc/Frlq4qWP9B6HaeZpfqchLF0wElQKshbBYwUcmlDv8z OgMO0hrNlwxyk7jxjuIl/GqgcXhwx5qfurdQ23blXCq0ogfrXPj8KSefq4vN/ia4HhRV BvUwTZ8gRMUIY62pZbHfEAcJrlU4uxfp6jxt/zVyadMlZviaDjapjkLzinkslWJ+E/Cc Ge1w== X-Forwarded-Encrypted: i=1; AJvYcCWDvvw2WjDoH5AxhElSFhicHfxaeoPADZUuUcS3X3/7VnziNpt1mCJ6LmkTIV1Qcf4Cgdprwnn01hsRubL3@lists.postgresql.org X-Gm-Message-State: AOJu0Ywl0CPBMgjhmPqav0ltTJKvhiZqmm/NJqo1QNt1Jk7m1EOD9aQW x8mM+dld2vnBXDPD0Wr/vpTlmS6dOWE+JCN0YhPt0fGotO2/MtJTBXYr4f2M3Fc20T3pm6qspOY OlG4e2bVyhww7mLpH9wCsfsnz+I7V6L8= X-Gm-Gg: AZuq6aKHg+prXZMrxf6u2rLc0K9yELT91kvucuiV516arhgaatz120P19nn5rfMeibA qh5vZgq9i/MXqRRVvX/Y+qoFu5oi3cCg54SG99E4ezbQAKPNMnEmKlST1BxHgaSnjrIV4Mrg5Tf WY3SpmI8ibgXVc6XDIkCWHlS2OtRjXEEIeyYV+vetCaXcCMjkidb+OpEEZIEgGxp4r5M31TGxGL cgo3PKKRzS33ZdMFgA8XZaXXoE9i6eB0zg74xL4st/fwyTTTSd5dinHoGZIKtPtnVR/zVHn0J1E fpa+DVkUx0LB8V1ixj4CMEefYH1S/rCwuMNth1SisCKdutGyBmRONAP87XEszQUs5NC1yz/C X-Received: by 2002:a2e:a58a:0:b0:386:b5c7:b655 with SMTP id 38308e7fff4ca-3881b8b42d6mr58610681fa.7.1771497418677; Thu, 19 Feb 2026 02:36:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Thu, 19 Feb 2026 16:06:46 +0530 X-Gm-Features: AaiRm50Z-9RZ4XRpf-8kvY2Dp4I5--3ZA_Ek8ct2vnvf-YJYmxgVuN5HtT2ZVCY Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: shveta malik , vignesh C , "David G. Johnston" , Dilip Kumar , Peter Smith , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers Content-Type: multipart/mixed; boundary="0000000000005c83a4064b2ae250" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005c83a4064b2ae250 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 19, 2026 at 10:13=E2=80=AFAM Shlok Kyal wrote: > > Thanks for reviewing the patch. I have addressed the remaining > comments in the v46 patch.. > Can we think of some ideas to split this patch? One possibility is that in the first patch we give an ERROR, if a non-root partitioned table is present in EXCEPT Clause. I see that a lot of code is written to handle partitions in EXCEPT clause. I feel such a split will make code easier to review and validate. Few other comments: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1. if (stmt->for_all_tables) { + /* Process EXCEPT table list */ + if (relations !=3D NIL) + { + Assert(rels !=3D NIL); + PublicationAddTables(puboid, rels, true, NULL); + } + /* * Invalidate relcache so that publication info is rebuilt. Sequences * publication doesn't require invalidation, as replica identity CacheInvalidateRelcacheAll(); Here, the relations listed in the except table list will be invalidated twice, once inside PublicationAddTables->publication_add_relation, and second time via CacheInvalidateRelcacheAll. Can we avoid that by adding a parameter to PublicationAddTables? 2. - root_relids =3D GetPublicationRelations(pubform->oid, - PUBLICATION_PART_ROOT); + root_relids =3D GetIncludedRelationsByPub(pubform->oid, + PUBLICATION_PART_ROOT); To follow the previous function naming pattern, can we rename GetIncludedRelationsByPub to GetIncludedPublicationRelations? If we agree to this then rename the excluded version of the function as well. 3. +/* + * Return the list of relation Oids for a publication. + * + * For a FOR TABLE publication, this returns the list of relations explici= tly + * included in the publication. + * + * Publications declared with FOR ALL TABLES/SEQUENCES should use + * GetAllPublicationRelations() to obtain the complete set of tables/seque= nces + * covered by the publication. + */ +List * +GetIncludedRelationsByPub(Oid pubid, PublicationPartOpt pub_partopt) This is equivalent to the existing function GetPublicationRelations() which has more precise comments atop. We can use the same comments unless there is any functionality difference. 4. --- a/src/backend/catalog/pg_publication.c +++ b/src/backend/catalog/pg_publication.c @@ -29,6 +29,7 @@ #include "catalog/pg_publication.h" #include "catalog/pg_publication_namespace.h" #include "catalog/pg_publication_rel.h" +#include "catalog/pg_subscription.h" It appears odd to include pg_subscription.h in the publication code. Is there a reason for the same? If not then avoid it. Apart from above, a few cosmetic changes are attached. --=20 With Regards, Amit Kapila. --0000000000005c83a4064b2ae250 Content-Type: text/plain; charset="US-ASCII"; name="v46_amit_1.patch.txt" Content-Disposition: attachment; filename="v46_amit_1.patch.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mltbspp00 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2NhdGFsb2cvcGdfcHVibGljYXRpb24uYyBiL3NyYy9i YWNrZW5kL2NhdGFsb2cvcGdfcHVibGljYXRpb24uYwppbmRleCBmNzFhZ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