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 1vq3KR-003Z0M-1r for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Feb 2026 06:04: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 1vq3JP-002baz-2q for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Feb 2026 06:02:56 +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 1vq3JP-002bar-1V for pgsql-hackers@lists.postgresql.org; Wed, 11 Feb 2026 06:02:56 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vq3JO-000000006Vr-0lrj for pgsql-hackers@lists.postgresql.org; Wed, 11 Feb 2026 06:02:56 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-4086661715cso4840646fac.2 for ; Tue, 10 Feb 2026 22:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770789771; cv=none; d=google.com; s=arc-20240605; b=g3kJEUjyW36diUX9wX3kwKW/OhqykZpg0g5RgkZ70jGx2A7sSRYq7fpPV8Jp6NdGn4 TMkpwY3EW8XVvtgPs/D/17vTA2uts5PC6uizclneQGIz8U34W8eeLqSn8xmnGs/iOKmE dMIdvq2lsZDAtL0r9YY5MQluW6jBNTM5TBmOFfq8ULH7xRtBHD3e1rZzilvJwEsJ1kTj 0PI7TvHP9N3KLuUoXGVe/6+eV/4T7HPUAd0ePrT7vdZizEN92Izo7Dd7taVGfkAqjx5g Ss1fAGRHx9+I+/IeqVW516f8PFowikxd0ONcU6FlBh5d70ZWwbb3beJ+mJbb4MQF/LWw zKng== 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:references:in-reply-to :mime-version:dkim-signature; bh=hVH5Crl2WzyPUSZKyjl20VpcDCSOvLWTCN02hQfZyrA=; fh=4Qmq5M50oxgyrj23o6ywEaIe7K60GQKzPFcNlsihcNo=; b=daoNMNil35nZ53Q0U9cyKfiW93i+BFMGayWTEjrgNGRrqAtUyox1CZfNU5u7NLyBz9 8Mv1gid/aLJ7lAMxFwsO6UsYRdW3dY/R6Ib+gOWcFa14Sc7FznmEX9qJRuy0s4MtCOW1 v+C70E5nK2d8YrgsXE1ZliMrWIHRJTJCTegtJagjLYbGI7cPxceM0AqHJU1fMIEW5ABn VBvSV+vIU3luOOybQookQreb7wzvNN5ZBO/TYfH2Jh7uC498LbwKlNLCMkqqKN1fFo09 O7oyjLLJ2op3EhhkR8f41NsxqnMb7/zHtcOXgN9jiLwkb32RWVlTAhu7sP6o1cmPhWZg xfkA==; 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=1770789771; x=1771394571; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hVH5Crl2WzyPUSZKyjl20VpcDCSOvLWTCN02hQfZyrA=; b=KWnv3VjRjVsKuR1+UYLegyvb6/sblLizqvWpueAP9/f/WCNi9nf2NIdDGv7b0+lK56 c/Ez9dtFM+ukUje+Ym3TttQzgPfgjXYx81649LxemO0UmJfXb7ixEvF60jDVljI9xKq8 U+xY4BxYwpNR8xZH7Tt3FbWUi1hnUGtfNciYl/t0oJm4En/tGXcQzNtWiZv5aUcgo6Rj AGyHmETNNHzEpc1UkW1ewnkXBsYSlyd8vG62nYwVCmNhtbpmRKYdOi0O7UEZMO9cVwvp mk3+eIspO8k2Y4z5ObGlvYM3eqHNZd+GdSebOJdSHp4gSvkME7HAF+VOYAODkE8y09oJ HIIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770789771; x=1771394571; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hVH5Crl2WzyPUSZKyjl20VpcDCSOvLWTCN02hQfZyrA=; b=CaJlVYcrhu6q3MlnbM/luRZWNvABDyyUrf8HP4NuQTt46OcXG+PxKm9RFCQPyV7EK4 5zEHDlX3/dL3Azcjsm1ymM2a8F3H6GXZlQWOLGLjvbKozoyAfsRjGQr0HIc5Cu0tyugu OZFYZLcPAnXZN6kjPPhLzqpNinSKE5Z0Gt3MUCQD10q2BwrGMhMrlquwaQmH/AgQ5J/M C5HRtFpzYxbKMZTarTfzW01iEhtiaM660MbQZAXgFGeCD0VkG09zeb3aC67/xldSEAm8 f4Ak4RRyK7v+klwHnVfvOAgNT4HNOqplMeiYiewI1XGJlKmu998xrX+f/8RCbPfUY/2m Q5hA== X-Forwarded-Encrypted: i=1; AJvYcCVeB/ThliCoXbR5F1ZrHZc5CRwnSo2GbPLVIZbBnIbM1FcGw4apuX5QayoVk9juqxkWBhyhku5WHqwMsOii@lists.postgresql.org X-Gm-Message-State: AOJu0YyRzJZbzFivrx2I8i/0gUmUI0WmDL1TKWAeZHXR67tDXa6JI3pH AscyqRso9kNgHdDnDHpdCFShhBITlop+v161Pa4COv1V9RJC9enVb90x5WxkT2PSpXPnfvllCDh nPOJuZg2qaHV3a1XyLD0vZ26EIcpfqJw= X-Gm-Gg: AZuq6aJEyH0VZ+oUcR/PlX3CiaBDqSuXJW65n6fZWYoDh0mpoWRxx0PRAZFsmO9y4m/ WgKnmcPxZELZekT8cxcOP4RverJ3zlsyqFldEUfE939zCPXCj+1/c61jrZYQq+wsepIsB5kNYb0 8akncKbo9Fxb/E5X6rdTuW43pt6tB+IK4hDevziadREA0/UxPnmteApoK/IAFzuneJgArJXQW24 5oihGb9LqAfaTxw9tMQ8+pZgrawRQnVi1GsecvnpMvRY6uVQlUiRgFt/RrYNs2VfIBk1EDVvJHI XFsLLXoP4dW4JhtjtxM= X-Received: by 2002:a05:6870:b024:b0:404:3941:4d60 with SMTP id 586e51a60fabf-40eaf689d08mr482000fac.2.1770789771519; Tue, 10 Feb 2026 22:02:51 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6802:284a:b0:61e:2744:d741 with HTTP; Tue, 10 Feb 2026 22:02:50 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Tue, 10 Feb 2026 22:02:50 -0800 X-Gm-Features: AZwV_QhyErpf2GcC9tkYXsJfTS0njVWRezx_vSZTPdJgxT_xCkZZBKPy2NZ9V80 Message-ID: Subject: Re: Skipping schema changes in publication To: shveta malik Cc: vignesh C , Amit Kapila , Peter Smith , Shlok Kyal , Dilip Kumar , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="0000000000004dacf1064a861fbf" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004dacf1064a861fbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 10, 2026, shveta malik wrote: > > > > The attached v42 version patch has the changes for the same. > > > > Thanks, will review. > Publication names are unique within the database. In check_publications_except_list, the use of =E2=80=9Cselect distinct=E2=80= =9D when pulling from pg_publication by name is unnecessary. Furthermore, if we only have a single publication name it is unnecessary to perform the check and thus no need to even run the query. David J. +check_publications_except_list(WalReceiverConn *wrconn, List *publications= ) +{ + WalRcvExecResult *res; + StringInfoData cmd; + TupleTableSlot *slot; + Oid tableRow[1] =3D {TEXTOID}; + List *except_publications =3D NIL; + + initStringInfo(&cmd); + appendStringInfoString(&cmd, + "SELECT DISTINCT p.pubname\n" + " FROM pg_catalog.pg_publication p\n" + " WHERE p.pubname IN ("); + + GetPublicationsStr(publications, &cmd, true); + + appendStringInfoString(&cmd, + ")\n" + " AND EXISTS (SELECT 1\n" + " FROM pg_catalog.pg_publication_rel pr\n" + " WHERE pr.prpubid =3D p.oid\n" + " AND pr.prexcept IS TRUE)"); --0000000000004dacf1064a861fbf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, February 10, 2026, shveta malik <shveta.malik@gmail.com> wrote:
>
> The attached v42 version patch has the changes for the same.
>

Thanks, will review.

Publication names are unique within the da= tabase.=C2=A0 In check_publications_except_list, the use of =E2=80=9Cselect= distinct=E2=80=9D when pulling from pg_publication by name is unnecessary.= =C2=A0 Furthermore, if we only have a single publication name it is unneces= sary to perform the check and thus no need to even run the query.
=

David J.


+check= _publications_except_list(WalReceiverConn *wrconn, List *publications)
+{
+ WalRcvExecResult *res;
+ StringInfoData cmd;
+ TupleTableSlot *slot= ;
+ Oid ta= bleRow[1] =3D {TEXTOID};
+ List =C2=A0 *except_publications =3D NIL;
+
=
+ init= StringInfo(&cmd);
+ appendStringInfoString(&cmd,
+ =C2=A0 "= ;SELECT DISTINCT p.pubname\n"
+ =C2=A0 " =C2=A0FROM pg_catal= og.pg_publication p\n"
+ =C2=A0 " WHERE p.pubname IN ("= );
+
+ GetPublicationsStr(publications, &cmd, true);
+
+ appendStringInfoString(&cmd,
+ =C2=A0 ")\n"
+ = =C2=A0 " =C2=A0 AND EXISTS (SELECT 1\n"
+ =C2=A0 " =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FROM pg_catalog.pg_pub= lication_rel pr\n"
+ =C2=A0 " =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0WHERE pr.prpubid =3D p.oid\n"
+ =C2=A0= " =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AND p= r.prexcept IS TRUE)");
--0000000000004dacf1064a861fbf--