At 2012-10-19 17:15:27 -0700, w...@heroku.com wrote:
>
> will=# \watch select now();
> Watch every 2s Fri Oct 19 17:09:23 2012
> 
>               now
> -------------------------------
>  2012-10-19 17:09:23.743176-07
> (1 row)

The patch looks OK at first glance, and I can confirm that it works as
intended. I can imagine this functionality being useful, e.g. to watch
pg_stat_activity or similar tables.

But a big part of why watch(1) is nice is that the output is overwritten
rather than scrolling. When it's scrolling, it's (a) difficult to notice
that something has changed, and (b) harder to compare values, especially
when the interval is short.

For these reasons, I can imagine using "watch -n2 psql -c …", but not
\watch in its present form. (Of course, I doubt anyone would be enthused
about a proposal to link ncurses into psql, but that's another matter.)

Maybe you should call it \repeat or something. I'm sure people would get
around to using \watch that way eventually. :-)

-- Abhijit


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to