Re: Add support for specifying tables in pg_createsubscriber.

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Shubham Khanna <khannashubham1197@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, vignesh C <vignesh21@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-25T08:36:16Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Support existing publications in pg_createsubscriber.


> On Sep 25, 2025, at 16:18, Shubham Khanna <khannashubham1197@gmail.com> wrote:
>> 
>> 
>> made_publication will always be set regardless of dry_run.
>> 
> 
> You’re right — I made a mistake in my earlier explanation.
> made_publication is always set in create_publication(), regardless of
> dry-run. I have double-checked the dry-run output across the cases,
> and from what I can see the messages are being logged correctly.
> 
> If you think there’s a specific combination where the dry-run logging
> isn’t behaving as expected, could you point me to it? From my testing
> it looks fine, but I want to be sure I’m not missing a corner case.
> 


I think, here you code has a logic difference from the old code:

* With the old code, even if drop_all_pubs, as long as dry_run, it will still run drop_publication().
* With your code, if drop_all_pubs, then never run drop_publication(), because you moved the logic into “else”.

To be honest, I am not 100% sure which is correct, I am just pointing out the difference.

Regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/