Re: psql \watch 2nd argument: iteration count - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: psql \watch 2nd argument: iteration count
Date
Msg-id 20230314190300.GB431737@nathanxps13
Whole thread Raw
In response to Re: psql \watch 2nd argument: iteration count  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: psql \watch 2nd argument: iteration count
List pgsql-hackers
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.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: "Gregory Stark (as CFM)"
Date:
Subject: Re: Raising the SCRAM iteration count
Next
From: Dmitry Dolgov
Date:
Subject: Re: pg_stat_statements and "IN" conditions