\watch stuck on execution of commands returning no tuples - Mailing list pgsql-hackers

From Michael Paquier
Subject \watch stuck on execution of commands returning no tuples
Date
Msg-id CAB7nPqTvtHEdgW5905BMvVx4wGz7RF0zYCUOY+wSJx8LTeMp6A@mail.gmail.com
Whole thread Raw
Responses Re: \watch stuck on execution of commands returning no tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi all,

When testing \watch, I noticed that process waits indefinitely when executing it with a DDL or a DML.
For example:
postgres=# CREATE TABLE aa (a int);
postgres=# ANALYSE aa \watch 10
-- Process waiting here

By referring at do_watch:command.c, the feature is made such as there is no error if command returns no tuples:
default:
    /* should we fail for non-tuple-result commands? */
    break;
The user can interrupt the process if wanted, but shouldn't it make more sense to return directly an error to the user instead of making the process wait indefinitely?

Regards,
--
Michael

pgsql-hackers by date:

Previous
From: Gavin Flower
Date:
Subject: Re: Documentation epub format
Next
From: Michael Paquier
Date:
Subject: Re: Recovery target 'immediate'