Re: patch to add \watch to psql - Mailing list pgsql-hackers

From Daniel Farina
Subject Re: patch to add \watch to psql
Date
Msg-id CAAZKuFbUNe=tJ7vpDBV4BX8gpo_RoC36aW0uYztV0bTyyOxBzw@mail.gmail.com
Whole thread Raw
In response to Re: patch to add \watch to psql  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
List pgsql-hackers
On Sat, Oct 20, 2012 at 12:19 AM, Abhijit Menon-Sen <ams@2ndquadrant.com> 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.

Part of the patch is that it disables the pager as so things just keep
being appended to the buffer.

However, I wonder if clever utilization of a pager would give you the
effect you mention with much the same code, and while allowing the old
behavior to be retained, as it is also useful.  (appending to the
screen, and not overwriting)

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 pqclear in there.

--
fdr



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields
Next
From: Guillaume Lelarge
Date:
Subject: Re: Bug in -c CLI option of pg_dump/pg_restore