Re: [PATCH] remove incorrect comment in pg_resetwal.c - Mailing list pgsql-hackers

From David Rowley
Subject Re: [PATCH] remove incorrect comment in pg_resetwal.c
Date
Msg-id CAApHDvqBVoO6uxSDBF9iYqWDvni76VYeb=ueZrvjbDsR-O7obQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] remove incorrect comment in pg_resetwal.c  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [PATCH] remove incorrect comment in pg_resetwal.c
List pgsql-hackers
On Fri, 16 Jan 2026 at 19:53, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Fri, Jan 16, 2026 at 02:45:42PM +0800, Gavin LYU wrote:
> > In the block handling the -e option, there’s a comment that appears to be a
> > copy-paste error (line 190 and 191). It references a second %s, but none
> > exists in that format string. Moreover, similar argument-handling code for
> > other options doesn’t include such a comment.
> >
> > I believe it should be removed.
>
> I disagree.  This note still looks helpful to me when it comes to
> translation even if it is incorrect: the %s markup refers to an option
> switch.

I think fixing it rather than removing it is the way to go. cc8d41511
removed the first va arg and didn't update the comment.

git diff cc8d41511~1..cc8d41511 -- */pg_resetwal.c | grep translator -C 3
@@ -156,13 +157,13 @@ main(int argc, char *argv[])
                                {
                                        /*------
                                          translator: the second %s is
a command line argument (-e, etc) */
-                                       fprintf(stderr, _("%s: invalid
argument for option %s\n"), progname, "-e");
+                                       pg_log_error("invalid argument
for option %s", "-e");
                                        fprintf(stderr, _("Try \"%s
--help\" for more information.\n"), progname);

We should delete "the second"

David



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: heap_create_with_catalog comments
Next
From: Soumya S Murali
Date:
Subject: Re: 001_password.pl fails with --without-readline