On Fri, Aug 29, 2014 at 6:33 PM, Heikki Linnakangas
<hlinnakan...@vmware.com> wrote:
> On 08/28/2014 02:46 PM, Fujii Masao wrote:
>>
>> On Tue, Aug 26, 2014 at 4:55 AM, Heikki Linnakangas
>> <hlinnakan...@vmware.com> wrote:
>>>
>>> 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
>>>> transaction handling.
>>
>>
>> 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.
>
>
> This comment:
>
>> ... We use PSQLexecWatch,
>> !                * which is kind of cheating, but SendQuery doesn't let us
>> suppress
>> !                * 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 each time
>>                  * through the loop since it's conceivable something
>> inside PSQLexec
>>                  * could change sigint_interrupt_jmp.
>>                  */
>
>
> This should now say "PSQLexecWatch".
>
> Other than that, looks good to me.

I just tested the patch and this feature works as expected if timing
is on and it displays the individual run time of each query kicked by
\watch. Note that --echo-hidden does not display the query run during
each loop and that this is contrary to the behavior in HEAD so it
breaks backward compatibility, but are there really people relying in
the existing behavior?
-- 
Michael


-- 
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