Re: patch to add \watch to psql

Поиск
Список
Период
Сортировка
От Daniel Farina
Тема Re: patch to add \watch to psql
Дата
Msg-id CAAZKuFbUNe=tJ7vpDBV4BX8gpo_RoC36aW0uYztV0bTyyOxBzw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: patch to add \watch to psql  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: enhanced error fields
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Bug in -c CLI option of pg_dump/pg_restore