pg_createsubscriber - more logging to say if there are no pubs to drop

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_createsubscriber - more logging to say if there are no pubs to drop
Date: 2025-10-09 01:33:25
Message-ID: CAHut+Ptm+WJwbbYXhC0s6FP_98KzZCR=5CPu8F8N5uV8P7BpqA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

While reviewing pg_createsubscriber in another thread, I found some of
the current logging to be confusing. Specifically, there is one part
that drops all existing publications. Sometimes it might look like
this:

----------
pg_createsubscriber: dropping all existing publications in database "db2"
pg_createsubscriber: dropping publication "pub_exists1" in database "db2"
pg_createsubscriber: dropping publication "pub_exists2" in database "db2"
pg_createsubscriber: dropping publication "pub_exists3" in database "db2"
----------

~~~

OTOH, if there is nothing found to be dropped, then the logging just says:

----------
pg_createsubscriber: dropping all existing publications in database "db2"
----------

That's the scenario that I found ambiguous. You can't be sure from the
logs what happened:
- Were there publications found, and were they dropped silently?
- Did it not find anything to drop?

~~~

Here is a small patch to remove that doubt. Now, if there is nothing
found, the logging would look like:

----------
pg_createsubscriber: dropping all existing publications in database "db2"
pg_createsubscriber: no publications found
----------

Thoughts?

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

Attachment Content-Type Size
v1-0001-say-if-there-are-no-pubs-to-drop.patch application/octet-stream 1.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Schneider 2025-10-09 01:47:40 Re: another autovacuum scheduling thread
Previous Message Jeremy Schneider 2025-10-09 01:25:20 Re: another autovacuum scheduling thread