Re: Skipping schema changes in publication - Mailing list pgsql-hackers

From Shlok Kyal
Subject Re: Skipping schema changes in publication
Date
Msg-id CANhcyEVB6XkVQ4YYN3x+P5NeG=tOWg-OWebGiqMp02XXMVUa6A@mail.gmail.com
Whole thread
In response to Re: Skipping schema changes in publication  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Skipping schema changes in publication
List pgsql-hackers
On Wed, 11 Feb 2026 at 11:32, David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> 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 database.  In check_publications_except_list, the use of “select distinct”
whenpulling from pg_publication by name is unnecessary.  Furthermore, if we only have a single publication name it is
unnecessaryto 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] = {TEXTOID};
> + List   *except_publications = 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 = p.oid\n"
> +   "                  AND pr.prexcept IS TRUE)");

Hi David,

We have addressed the comments in the latest v43 patch.
Also we have refactored the code in
'pg_get_publication_effective_tables' and added comments to make it
simpler to understand.

Thanks,
Shlok Kyal

Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: Streaming replication and WAL archive interactions
Next
From: Alexander Pyhalov
Date:
Subject: Re: Asynchronous MergeAppend