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.