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

From Kyotaro Horiguchi
Subject Re: psql \watch 2nd argument: iteration count
Date
Msg-id 20230314.135859.260879647537075548.horikyota.ntt@gmail.com
Whole thread Raw
In response to psql \watch 2nd argument: iteration count  (Andrey Borodin <amborodin86@gmail.com>)
Responses Re: psql \watch 2nd argument: iteration count  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
At Tue, 14 Mar 2023 11:36:17 +0900, Michael Paquier <michael@paquier.xyz> wrote in 
> Ok, thanks for looking.  Let's wait a bit and see if others have an
> opinion to offer.  At least, the CI is green.

+                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);


It looks good other than that.

By the way, I noticed that \watch erases the query buffer. That
behavior differs from other commands, such as \g. And the difference
is not documented. Why do we erase the query buffer only in the case
of \watch?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: CI and test improvements
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Improve logging when using Huge Pages