Re: [HACKERS] psql and Control-C

Chris <chrisb@nimrod.itg.telstra.com.au>

From: Chris Bitmead <chrisb@nimrod.itg.telstra.com.au>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgreSQL.org>
Date: 2000-02-17T23:34:09Z
Lists: pgsql-hackers
Peter Eisentraut wrote:
> 
> Some people have indicated that they don't like how psql currently handles
> Control-C if no query is in progress. I consider the behaviour of the
> shells desirable but, quite frankly, I don't know how to do it.

The typical way to do this sort of thing is to longjmp back to the main
loop. And I think if you look at sig.c in bash, this is probably what
they are doing.

> Actually, shouldn't a Ctrl-C in a script cancel the query *and* stop the
> script at all times?

Yes.