Re: psql \watch 2nd argument: iteration count

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: psql \watch 2nd argument: iteration count
Дата
Msg-id 20230314.135859.260879647537075548.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на psql \watch 2nd argument: iteration count  (Andrey Borodin <amborodin86@gmail.com>)
Ответы Re: psql \watch 2nd argument: iteration count  (Nathan Bossart <nathandbossart@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: CI and test improvements
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Improve logging when using Huge Pages