Re: psql \watch 2nd argument: iteration count

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: psql \watch 2nd argument: iteration count
Дата
Msg-id ZA55mDWN+E7D7MBF@paquier.xyz
обсуждение исходный текст
Ответ на Re: psql \watch 2nd argument: iteration count  (Andrey Borodin <amborodin86@gmail.com>)
Ответы Re: psql \watch 2nd argument: iteration count  (Michael Paquier <michael@paquier.xyz>)
Re: psql \watch 2nd argument: iteration count  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On Sun, Mar 12, 2023 at 01:05:39PM -0700, Andrey Borodin wrote:
> 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);

-       HELP0("  \\watch [SEC]           execute query every SEC seconds\n");
+       HELP0("  \\watch [SEC [N]]       execute query every SEC seconds N times\n");

Is that really the interface we'd want to work with in the long-term?
For one, this does not give the option to specify only an interval
while relying on the default number of seconds.  This may be fine, but
it does  not strike me as the best choice.  How about doing something
more extensible, for example:
\watch [ (option=value [, option=value] .. ) ] [SEC]

I am not sure that this will be the last option we'll ever add to
\watch, so I'd rather have us choose a design more flexible than
what's proposed here, in a way similar to \g or \gx.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Requiring recovery.signal or standby.signal when recovering with a backup_label
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: psql \watch 2nd argument: iteration count