Re: [HACKERS] patch to add \watch to psql

2013-04-04 Thread Will Leinweber
On Thu, Apr 4, 2013 at 5:04 PM, Tom Lane wrote: > > I whacked this around some more, added basic docs, and committed it. > > Thanks! > > Unfortunately rl_clear_screen() is not included at all in libedit, > causing > > compilation to fail, and I was completely unable to find a way to > > distin

Re: [HACKERS] patch to add \watch to psql

2013-04-04 Thread Tom Lane
Will Leinweber writes: > Here is an updated patch that addresses several of the points brought up so > far, such as the sleep, internationalization banner, and zero wait check, > and it removes the premature input check. I whacked this around some more, added basic docs, and committed it. > Unfo

Re: [HACKERS] patch to add \watch to psql

2013-04-03 Thread Dickson S. Guedes
2013/4/3 Will Leinweber : > Here is an updated patch that addresses several of the points brought up so > far, such as the sleep, internationalization banner, and zero wait check, > and it removes the premature input check. > > Unfortunately rl_clear_screen() is not included at all in libedit, caus

Re: [HACKERS] patch to add \watch to psql

2013-04-03 Thread Will Leinweber
Here is an updated patch that addresses several of the points brought up so far, such as the sleep, internationalization banner, and zero wait check, and it removes the premature input check. Unfortunately rl_clear_screen() is not included at all in libedit, causing compilation to fail, and I was

Re: [HACKERS] patch to add \watch to psql

2013-03-26 Thread Peter Eisentraut
On 3/24/13 3:10 PM, Tom Lane wrote: > I also concur with the complaint here > http://www.postgresql.org/message-id/caazkufzxyj-rt1aec6s0g7zm68tdlfbbm1r6hgrbbxnz80k...@mail.gmail.com > that allowing a minimum sleep of 0 is rather dangerous The original "watch" command apparently silently corrects a

Re: [HACKERS] patch to add \watch to psql

2013-03-24 Thread Tom Lane
Daniel Farina writes: > The name \repeat has grown on me, but I haven't bothered renaming it > for the time being. I think sameness with the familiar 'watch' > program may not be such a big deal as I thought originally, but > 'repeat' sounds a lot more like a kind of flow control for scripts, > w

Re: [HACKERS] patch to add \watch to psql

2013-01-20 Thread Craig Ringer
On 01/21/2013 02:11 AM, Dickson S. Guedes wrote: > 2013/1/17 Daniel Farina : >> I realized while making my adjustments that I pointlessly grew some input >> checking in the inner loop. I just hoisted it out in this version. > Since psql uses libreadline, what do you think about to call > rl_clear_

Re: [HACKERS] patch to add \watch to psql

2013-01-20 Thread Dickson S. Guedes
2013/1/17 Daniel Farina : > I realized while making my adjustments that I pointlessly grew some input > checking in the inner loop. I just hoisted it out in this version. Since psql uses libreadline, what do you think about to call rl_clear_screen() inside that "while (true)" loop? Obviously we s

Re: [HACKERS] patch to add \watch to psql

2013-01-17 Thread Daniel Farina
On Thu, Jan 17, 2013 at 5:07 PM, Daniel Farina wrote: > I have adjusted this patch a little bit to take care of the review > issues, along with just doing a bit of review myself. I realized while making my adjustments that I pointlessly grew some input checking in the inner loop. I just hoisted

Re: [HACKERS] patch to add \watch to psql

2013-01-17 Thread Daniel Farina
I have adjusted this patch a little bit to take care of the review issues, along with just doing a bit of review myself. On Thu, Oct 25, 2012 at 2:25 AM, Will Leinweber wrote: > Thanks for the reviews and comments. Responses inline: > . > On Sat, Oct 20, 2012 at 9:19 AM, Abhijit Menon-Sen > wro

Re: [HACKERS] patch to add \watch to psql

2012-10-25 Thread Daniel Farina
> On Sat, Oct 20, 2012 at 9:49 PM, Daniel Farina wrote: >> >> An unrelated defect, although the patch tries to carefully clean up >> the 'res' result from psqlexec in the error cases, it does forget to >> do that, seemingly, in the 'positive' case, while it is looping. I >> think it needs another

Re: [HACKERS] patch to add \watch to psql

2012-10-24 Thread Peter Eisentraut
On 10/19/12 8:15 PM, Will Leinweber wrote: > This patch adds \watch to psql. It is much like the unix equivalent, > defaulting to every 2 seconds, and allowing you optionally specify a > number of seconds. This doesn't handle multiline queries: => \watch select 1 + ERROR: 42601: syntax error at

Re: [HACKERS] patch to add \watch to psql

2012-10-20 Thread Daniel Farina
On Sat, Oct 20, 2012 at 12:19 AM, Abhijit Menon-Sen wrote: > 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.) A good point. P

Re: [HACKERS] patch to add \watch to psql

2012-10-20 Thread Abhijit Menon-Sen
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

[HACKERS] patch to add \watch to psql

2012-10-19 Thread Will Leinweber
This patch adds \watch to psql. It is much like the unix equivalent, defaulting to every 2 seconds, and allowing you optionally specify a number of seconds. I will add this to the commit fest app. Thanks, Will Leinweber Example: psql (9.3devel, server 9.1.4) Type "help" for help. will=# \watch