Re: Skipping schema changes in publication

Shlok Kyal <shlok.kyal.oss@gmail.com>

From: Shlok Kyal <shlok.kyal.oss@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>, vignesh C <vignesh21@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, YeXiu <1518981153@qq.com>, Ian Lawrence Barwick <barwick@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-12T06:58:28Z
Lists: pgsql-hackers

Attachments

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” 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] = {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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix miscellaneous issues in EXCEPT publication clause.

  2. Change syntax of EXCEPT TABLE clause in publication commands.

  3. Add support for EXCEPT TABLE in ALTER PUBLICATION.

  4. Allow table exclusions in publications via EXCEPT TABLE.

  5. Add wait_for_subscription_sync for TAP tests.