Re: psql \watch 2nd argument: iteration count

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: nathandbossart(at)gmail(dot)com
Cc: michael(at)paquier(dot)xyz, amborodin86(at)gmail(dot)com, sfrost(at)snowman(dot)net, peter(dot)eisentraut(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org, samokhvalov(at)gmail(dot)com
Subject: Re: psql \watch 2nd argument: iteration count
Date: 2023-03-15 01:19:28
Message-ID: 20230315.101928.705728360363587489.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 14 Mar 2023 12:03:00 -0700, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote in
> On Tue, Mar 14, 2023 at 01:58:59PM +0900, Kyotaro Horiguchi wrote:
> > + if (*opt_end)
> > + pg_log_error("\\watch: incorrect interval value '%s'", opt);
> > + else if (errno == ERANGE)
> > + pg_log_error("\\watch: out-of-range interval value '%s'", opt);
> > + else
> > + pg_log_error("\\watch: interval value '%s' less than zero", opt);
> >
> > I'm not sure if we need error messages for that resolution and I'm a
> > bit happier to have fewer messages to translate:p. Merging the cases
> > of ERANGE and negative values might be better. And I think we usually
> > refer to unparsable input as "invalid".
> >
> > if (*opt_end)
> > pg_log_error("\\watch: invalid interval value '%s'", opt);
> > else
> > pg_log_error("\\watch: interval value '%s' out of range", opt);
>
> +1, I don't think it's necessary to complicate these error messages too
> much. This code hasn't reported errors for nearly 10 years, and I'm not
> aware of any complaints. I till think we could simplify this to "\watch:
> invalid delay interval: %s" and call it a day.

I hesitated to propose such a level of simplification, but basically I
was alsothinking the same thing.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-03-15 01:24:54 Re: psql \watch 2nd argument: iteration count
Previous Message Andres Freund 2023-03-15 01:03:21 Re: Making background psql nicer to use in tap tests