Re: psql \watch 2nd argument: iteration count

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: amborodin86(at)gmail(dot)com, nathandbossart(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-14 04:58:59
Message-ID: 20230314.135859.260879647537075548.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 14 Mar 2023 11:36:17 +0900, Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2023-03-14 05:02:19 Re: Improve logging when using Huge Pages
Previous Message Justin Pryzby 2023-03-14 04:56:56 Re: CI and test improvements