Re: sigint psql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: John DeSoi <desoi(at)pgedit(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sigint psql
Date: 2005-02-21 17:39:09
Message-ID: 200502211739.j1LHd9S15675@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Doug McNaught wrote:
> John DeSoi <desoi(at)pgedit(dot)com> writes:
>
> > I'm communicating with psql via a pipe stream. This works pretty well,
> > but one problem I have is trying to cancel an operation. If I send a
> > sigint, psql dies. In looking at the source I gather this is because
> > it assumes I'm in non-interactive mode (pset.notty is true). I was
> > wondering if there was some way to work around this short of
> > recompiling the source. I need to do the same thing on Windows.
> >
> > Thanks for any suggestions,
>
> On Unix you could run 'psql' through a pty rather than a pipe. No
> idea what the Windows equivalent would be.

We don't have signals on win32 like we have on Unix so we simulate them.
Not sure it is possible to signal psql like you want on Win32.

I just tried 'kill -2 _psql_pid_' on unix and it did cancel the current
query.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-02-21 17:50:10 Re: Data loss, vacuum, transaction wrap-around
Previous Message Sailesh Krishnamurthy 2005-02-21 16:51:10 Re: Query optimizer 8.0.1 (and 8.0)