On 08/28/2014 02:46 PM, Fujii Masao wrote:
On Tue, Aug 26, 2014 at 4:55 AM, Heikki Linnakangas
On 08/25/2014 10:48 PM, Heikki Linnakangas wrote:
Actually, perhaps it would be better to just copy-paste PSQLexec, and
modify the copy to suite \watch's needs. (PSQLexecWatch?
SendWatchQuery?). PSQLexec doesn't do much, and there isn't very much
overlap between what \watch wants and what other PSQLexec callers want.
\watch wants timing output, others don't. \watch doesn't want
Agreed. Attached is the revised version of the patch. I implemented
PSQLexecWatch() which sends the query, prints the results and outputs
the query execution time (if \timing is enabled).
This patch was marked as ready for committer, but since I revised
the code very much, I marked this as needs review again.
... We use PSQLexecWatch,
! * which is kind of cheating, but SendQuery doesn't let us
! * autocommit behavior.
is a bit strange now. PSQLexecWatch isn't cheating like reusing PSQLexec
was; it's whole purpose is to run \watch queries.
* Set up cancellation of 'watch' via SIGINT. We redo this
* through the loop since it's conceivable something inside
* could change sigint_interrupt_jmp.
This should now say "PSQLexecWatch".
Other than that, looks good to me.
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: