\watch stuck on execution of commands returning no tuples

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: \watch stuck on execution of commands returning no tuples
Date: 2013-05-02 04:36:42
Message-ID: CAB7nPqTvtHEdgW5905BMvVx4wGz7RF0zYCUOY+wSJx8LTeMp6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-05-02 04:45:41 Re: [HACKERS] Documentation epub format
Previous Message Gavin Flower 2013-05-02 03:36:57 Re: Documentation epub format