Re: Prevent psql \watch from running queries that return no rows

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: Prevent psql \watch from running queries that return no rows
Дата
Msg-id CAKAnmmLoiePXb9W9V+Jig9Rai2AuuTWxdz5kutJuqmTGQoDK7Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Prevent psql \watch from running queries that return no rows  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: Prevent psql \watch from running queries that return no rows  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Thanks for the feedback!

On Wed, Jul 5, 2023 at 5:51 AM Daniel Gustafsson <daniel@yesql.se> wrote:

The comment on ExecQueryAndProcessResults() needs to be updated with an
explanation of what this parameter is.

I added a comment in the place where min_rows is used, but not sure what you mean by adding it to the main comment at the top of the function?  None of the other args are explained there, even the non-intuitive ones  (e.g. svpt_gone_p)

-       return cancel_pressed ? 0 : success ? 1 : -1;
+       return (cancel_pressed || return_early) ? 0 : success ? 1 : -1;

I think this is getting tangled up enough that it should be replaced with
separate if() statements for the various cases.

Would like to hear others weigh in, I think it's still only three states plus a default, so I'm not convinced it warrants multiple statements yet. :)

+       HELP0("  \\watch [[i=]SEC] [c=N] [m=ROW]\n");
+       HELP0("                          execute query every SEC seconds, up to N times\n");
+       HELP0("                          stop if less than ROW minimum rows are rerturned\n");

"less than ROW minimum rows" reads a bit awkward IMO, how about calling it
[m=MIN] and describe as "stop if less than MIN rows are returned"?  Also, there
is a typo: s/rerturned/returned/.

Great idea: changed and will attach a new patch

Cheers,
Greg


Вложения

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

Предыдущее
От: "Euler Taveira"
Дата:
Сообщение: Re: Allow specifying a dbname in pg_basebackup connection string
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: logicalrep_message_type throws an error