Re: psql \watch 2nd argument: iteration count
Andrey Borodin <amborodin86@gmail.com>
From: Andrey Borodin <amborodin86@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, sfrost@snowman.net, peter.eisentraut@enterprisedb.com, pgsql-hackers@postgresql.org
Date: 2023-03-12T20:05:39Z
Lists: pgsql-hackers
Attachments
- v5-0002-Add-iteration-count-argument-to-psql-watch-comman.patch (application/octet-stream) patch v5-0002
- v5-0001-Fix-incorrect-argument-handling-in-psql-watch.patch (application/octet-stream) patch v5-0001
On Thu, Mar 9, 2023 at 11:25 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> + pg_log_error("Watch period must be non-negative number, but argument is '%s'", opt);
>
> After looking around at the other error messages in this file, I think we
> should make this more concise. Maybe something like
>
> pg_log_error("\\watch: invalid delay interval: %s", opt);
In the review above Kyotaro-san suggested that message should contain
information on what it expects... So, maybe then
pg_log_error("\\watch interval must be non-negative number, but
argument is '%s'", opt); ?
Or perhaps with articles? pg_log_error("\\watch interval must be a
non-negative number, but the argument is '%s'", opt);
>
> + free(opt);
> + resetPQExpBuffer(query_buf);
> + return PSQL_CMD_ERROR;
>
> Is this missing psql_scan_reset(scan_state)?
Yes, fixed.
Best regards, Andrey Borodin.
Commits
-
psql: add an optional execution-count limit to \watch.
- 00beecfe839c 16.0 landed
-
Improve handling of psql \watch's interval argument
- 6f9ee74d45aa 16.0 landed