Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDZu-0005qh-KH for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jan 2019 20:32:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goDZr-0008Np-RH for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jan 2019 20:32:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDZr-0008Ni-Kr for pgsql-bugs@lists.postgresql.org; Mon, 28 Jan 2019 20:32:19 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDZk-0005P1-Rh for pgsql-bugs@postgresql.org; Mon, 28 Jan 2019 20:32:19 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1goDZi-000871-F2; Mon, 28 Jan 2019 15:32:10 -0500 Date: Mon, 28 Jan 2019 15:32:10 -0500 From: Bruce Momjian To: Tom Lane Cc: Francisco Olarte , rodrigo_de_carlos@yahoo.com, pgsql-bugs@postgresql.org Subject: Re: Suggestion: include interruption method for \watch option (page 1922, PostgreSQL 11.1 Documentation) Message-ID: <20190128203210.GE26761@momjian.us> References: <007901d4b3c3$d6544ab0$82fce010$@yahoo.com> <17021.1548342192@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17021.1548342192@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 24, 2019 at 10:03:12AM -0500, Tom Lane wrote: > Francisco Olarte writes: > > On Thu, Jan 24, 2019 at 10:33 AM wrote: > >> I used the \watch option in psql and couldn’t stop the loop until I found the way* using ctrl-c. I am new to programming, and perhaps using ctrl-c is standard practice, but in a future manual perhaps you should replace the text below ‘until interrupted’ with ‘until interrupted (using ctrl-c)’. > > > Ctrl-C, AFAIK, sends the INT(errupt) signal in *ix, which normally > > stops looping things. That's the standard way to interrupt long > > running commands, send them the interrupt signal. > > > IIRC windows does similar stuff, although I think Ctrl-break had to be > > used, but I haven't used it since the dawn of the century. > > Yeah, the reason that the message doesn't already mention control-c > is that the interrupt signal varies depending on platform (also, > it's possible to remap it to some other key, on most platforms). > In the end we expect you to know that much about whatever environment > you're using. Well, in psql we ended up just suggesting the likely default for exiting psql: #ifndef WIN32 puts(_("Use control-D to quit.")); #else puts(_("Use control-C to quit.")); #endif Not sure if we could do the same thing here. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +