Re: pg_createsubscriber --dry-run logging concerns
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, Euler Taveira <euler@eulerto.com>, "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-11T09:17:41Z
Lists: pgsql-hackers
Attachments
On 2025-Nov-10, Peter Smith wrote: > Hi Alvaro, > > Here is patch v4-0001 modified as requested: > - dashes are removed > - the message is a single string Okay, thanks. I split the strings in two lines, as we customarily do when they contain embedded newlines. I also noticed pg_resetwal uses stdout rather than stderr and set out to change it, because I don't think it's sensible to have one program behave one way (print to stdout) when all others behave in another (to stderr). I wrote a commit message and was about ready to push. However, I then found out that the reason you used stdout instead of stderr in pg_resetwal is that with the latter, tests fail all over the place because of pg_resetwal -n being used for pg_upgrade internally via popen(), and making it write to stderr results in confusing pg_upgrade output as well as test failures. A very simple fix for this problem would be, of course, to add " 2>/dev/null" to the popen call, but that is not only cheating, it is also dangerous: if pg_resetwal ever finds reason to complain, we won't get very good information because of that redirection. (I also don't think this line belongs in stdout, in case you're thinking of changing it in the other direction for all other programs.) Maybe we should add a -q,--silent mode that suppresses the "Running in dry-run mode" line. I do wonder if this is getting too far into the weeds for such a small thing. I won't blame you if you want to just drop this whole idea, but I also won't stop you if you want to introduce --silent. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "No necesitamos banderas No reconocemos fronteras" (Jorge González)
Commits
-
Split dry-run messages into primary and detail
- 36b1a1e826ea 19 (unreleased) landed
- e3b5817c8b89 master landed
-
Log a note at program start when running in dry-run mode
- c05dee191125 19 (unreleased) landed
-
Use USECS_PER_SEC from datatype/timestamp.h
- ad1581d7feae 19 (unreleased) landed
-
Remove WaitPMResult enum in pg_createsubscriber
- f242dbcede9c 19 (unreleased) landed
-
pg_createsubscriber: reword dry-run log messages
- c25314d5364e 18.1 landed
- 2648eab3779b 19 (unreleased) landed