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 1w2SBU-000IuT-0Y for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 11:02:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2SBT-000eYl-0D for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 11:01:59 +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 1w2SBS-000eYd-1k for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 11:01:58 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2SBO-00000000Al1-3ohq for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 11:01:57 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-35a07c4b17dso2385035a91.2 for ; Tue, 17 Mar 2026 04:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773745315; cv=none; d=google.com; s=arc-20240605; b=Lh94yEQBsGj0ZBgO81EezPj+yxujHNFcQb2eGdEv5BiBBvRWhMX2dRJJMK54XBL3AV 0t6pIDrbrNSEg/jWKXyFqRzWS3rTpfAL/va0Qd0Zxof3/X6KZAEOnpkgMEkWbesrUjDI yrJz8GScrbcot1DaplNmq8r9lpud1GzSgARH4gNo06JLSERkzWJl/8+dcJM9cAlxb/zk xhKKIHBeWU4aQNRpa369qkbIuFyvPjO735NQ5H1MG4MMo7L8MuhoCjn3zfh70PBkNYRb xT9XGqX217KtfyKucM3AS0U/7wWkj0R/G3KZY5KK3sr/64PJjw/GiXnAVyNxDX9/qyAg jS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6YvJesw9MbUfYgCaPQdTTVTtUxsifasmVnYSpDcKQz0=; fh=/E036i6FNM+D9qZ9oQJeNOxdeFg5CVdYUpXltIS65p0=; b=T03ctWK7AxdEKNZep/IodSBPJKfXNuo/x+i426q6BrnYL/lhraPIrbOzxurL2Y6X/P +Ip74rk0Hmnd+xwbB+9CAPG0US/TyYceDN/Bh+liHlpx3gM9Di9hoAjyxSW81anQwSH8 k9CHUaGai7SgbiLY7zfnFb4AGiEn7dsjEdPQyBvVXEkNvjvvX4lYlcKzAOG6kPScDIZD EwZKbzBAQFrkaXoNq7RZ8RyUDChvqzFH/eqokUwzA0fV+H6KyTTOM+Rdh9VUo/LDwuCx 63hriUfQHY7zZpElSZ1Jg4qX8UvE5hu1HgfDo7EP1NakkDhzqb50EGw9SfwUwtga3cnT 8oRQ==; 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=1773745315; x=1774350115; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6YvJesw9MbUfYgCaPQdTTVTtUxsifasmVnYSpDcKQz0=; b=XJRcUn1mWrk9YlbeHEz6a8EU4zXudNKltD7qRA1cenqAUuxhUgIKa+M3jo43i9Pc4U EZ18PzdvGN/uQxxtc7Ri6q8URCIkxhlpooOEJuWYfxEugxmGoL5sS0GvpnqAvkjlDJIQ xfIR/UNcnzow8FJj/323uU9U0bwdRP7gjvYP/R5aZ/MJ2jD9EBQwSC8nuKsxkKrJpYmd VK9zPZZQuq6jqZEoA93Le1YPWX2ZaPXF+1TNqZl8j5jei/ZxYiK3R4QzgWEvhHcgZyw0 LZ3OBrYb7SJpyNZsz0HF3xKF6DchgKG+u5Mvd2XGSFcoNgRtvvKnf5fIFHCXtjBRoTh9 pBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773745315; x=1774350115; h=content-transfer-encoding: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=6YvJesw9MbUfYgCaPQdTTVTtUxsifasmVnYSpDcKQz0=; b=bv1K0jGjTbVu0Eu6BNc17vEmWozSHxlwdsjVFlMzkvdvPOetWcSj4bPnTPSPceLn3f bQzj1RIPR4gr0y/rVOkTVV6LWcjF2vrX6oFKteuCbYO1RGMK/yI5a0QgQyNZy89yzZuz xhj04MKj7E16449wFVGtQoCa3SMdoBs+ml4QjWAY9M6jVnDOU8+MRU/wPhqRDFTcmEXw 1xrDxlkpzwkNAjDmg/WdCmDWLJ22sfvNeYLjmOQo0KOoLdFYd7p89eHHgU+9690x8K/L CWib14M8FTz2tQQb9LotKJyFPmltf4/g8cRPzPbYOklbTE93EIssnBir6hkSDggmQgQM hMFA== X-Forwarded-Encrypted: i=1; AJvYcCUMNGjM0w6gO9xwCKl+r6Bx+ORRseksfdm9aTXNvKe5vnQEPAAEC59b5qRJu4NnUBilbxS/zMREloaElRw6@lists.postgresql.org X-Gm-Message-State: AOJu0YzQZY4krLXbIcy0eAjeUOUR/4Kp9b/Q6/4gZbBMVVvJzbJSYMH7 dTOh11eXi4TTTYaKigjtgR1gNTXylgmeEDrulFW5Bc+QIBhypsXcgR0G1VdXSONkxZpubtBFLA4 5LgvetQ4WrIGZNdEXWd9PBIuUFbllfKU= X-Gm-Gg: ATEYQzzOMNIIFc5Umb/+v73DJgWvAjmT8vG6lG0Q51eFL2ge326MF4it7EJKjgnz3oT Jmbyky/fJ+nq8ZY0ojudm/hm63CPBRkxus1e5lJdB0d3Urgb98/fXcF0IyN1nABiV6ky1bAAbsp IG+oGhJToyAVKhZREdrisSvREhoYifuv0jRAIsmc2AWkWncLuA9ppqd+kV7sS+UmOYoiL1bHNLi VRuqyqx1rCGfsZADW+KXHqs7ie1lYN/YECN6qUkm+lhF6jmNFezouAM+yWnUKtjaB6oYhC9hqhe OZ7hXdjiHqHLtrZPb6CjMBesi03qjqzHAFUs4axZ9kIsTAwJWd38tw== X-Received: by 2002:a17:90b:3810:b0:35a:1b43:dff1 with SMTP id 98e67ed59e1d1-35a21e9ef44mr14679870a91.12.1773745315343; Tue, 17 Mar 2026 04:01:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Tue, 17 Mar 2026 16:31:43 +0530 X-Gm-Features: AaiRm52zEe99ylECVKoD1PoZUzdDjG-J749IC9t4DYSaRIW8Vho-RQt7FYb5W_0 Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: Peter Smith , Amit Kapila , Masahiko Sawada , "Hayato Kuroda (Fujitsu)" , 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 , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 17, 2026 at 12:23=E2=80=AFPM vignesh C wr= ote: > > Thanks for the comments, the agreed comments have been addressed in > the v64 version patch attached. > Please find a few comments: 1) + 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 li= st of + tables, the existing except table list is replaced with the specified tables. + If EXCEPT TABLE is omitted, the existing except tabl= e + list is cleared. How about changing it to (or anything better to reflect new changes): The SET ALL TABLES clause can transform an empty publication, or one defined for ALL SEQUENCES (or both ALL TABLES and ALL SEQUENCES), into a publication defined for ALL TABLES. Likewise, SET ALL SEQUENCES can convert an empty publication, or one defined for ALL TABLES (or both ALL TABLES and ALL SEQUENCES), into a publication defined for ALL SEQUENCES. In addition, SET ALL TABLES may be 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 exclusion list is replaced with the specified tables. If EXCEPT TABLE is omitted, the existing exclusion list is cleared. 2) +bool +is_include_relation_publication(Oid pubid) The name 'is_include_relation_publication' looks slightly odd to me. Few options are: is_explicit_table_publication, is_table_list_publication, is_table_publication. Or anything better if you can think of? 3) is_include_relation_publication: + /* If we find even one included relation, we are done */ + if (!pubrel->prexcept) + { + result =3D true; + break; + } we can break the loop irrespective of the 'prexcept' flag as we can never have a combination of mixed prexcept entries for the same pub. Whether all will be with prexcept=3Dtrue or all will be false. Even a loop is not needed. We can fetch the first entry alone (similar to is_schema_publication) and if that is valid, we can check the flag and return accordingly. Something like: if (HeapTupleIsValid()) { pubrel =3D (Form_pg_publication_rel) GETSTRUCT(tup); result =3D !pubrel->prexcept } 4) publication_add_relation: + /* + * True if EXCEPT tables require explicit relcache invalidation. If + * 'puballtables' changes, global invalidation covers them. + */ + inval_except_table =3D (stmt !=3D NULL) && + (stmt->for_all_tables =3D=3D pub->alltables); It took me some time to figure out why we don't need invalidation for the case where we are converting ALL SEQ to ALL TABLEs EXCEPT(..). I think it is worth adding more comments here. Suggestion: /* * Determine whether EXCEPT tables require explicit relcache invalidation. * * For CREATE PUBLICATION with EXCEPT tables, invalidation is not needed, * since it is handled when marking the publication as ALL TABLES. * * For ALTER PUBLICATION, invalidation is needed only when adding an EXCEPT * table to a publication already marked as ALL TABLES. For publications * that were originally empty or defined as ALL SEQUENCES and are being * converted to ALL TABLES, invalidation is skipped here, as it is handled * when marking the publication as ALL TABLES. */ thanks Shveta