Thanks for the feedback!

On Wed, Jul 5, 2023 at 5:51 AM Daniel Gustafsson <dan...@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

Attachment: psql_watch_exit_on_zero_rows_v3.patch
Description: Binary data

Reply via email to