Re: psql \watch 2nd argument: iteration count

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Andrey Borodin <amborodin86@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, sfrost@snowman.net, peter.eisentraut@enterprisedb.com, pgsql-hackers@postgresql.org
Date: 2023-03-09T19:25:26Z
Lists: pgsql-hackers
+				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);

+				free(opt);
+				resetPQExpBuffer(query_buf);
+				return PSQL_CMD_ERROR;

Is this missing psql_scan_reset(scan_state)?

I haven't had a chance to look closely at 0002 yet.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



Commits

  1. psql: add an optional execution-count limit to \watch.

  2. Improve handling of psql \watch's interval argument