Re: Add support for specifying tables in pg_createsubscriber.

Peter Smith <smithpb2250@gmail.com>

From: Peter Smith <smithpb2250@gmail.com>
To: Shubham Khanna <khannashubham1197@gmail.com>
Cc: Chao Li <li.evan.chao@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-11-03T07:24:39Z
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.

Hi Shubham.

A comment about the v17-0001.

======
1.
+ if (check_publication_exists(conn, dbinfo[i].pubname, dbinfo[i].dbname))
+ {
+ /* Reuse existing publication on publisher. */
+ pg_log_info("dry-run: would use existing publication \"%s\" in
database \"%s\"",
+ dbinfo[i].pubname, dbinfo[i].dbname);
+ dbinfo[i].made_publication = false;
+ }

Is that correct? Won't this code now unconditionally log with the
"dry-run:" prefix, even when the tool is *not* doing a dry-run?

I thought code would be something like:

SUGGESTION #1 (if/else)
/* Reuse existing publication on publisher. */
if (dry_run)
  pg_log_info("dry-run: would use existing publication ...);
else
  pg_log_info("use existing publication ...);

~~~

OTOH, (since here is just an info message with no destructive
operation) perhaps it would be harmless also to keep the original log
message for both dry-run and normal mode.

SUGGESTION #2 (do nothing)
pg_log_info("use existing publication ...);

======
Kind Regards,
Peter Smith.
Fujitsu Australia