"Gregory Wood" <gregw@com-stock.com> writes:
>> The client might have long since given up and disconnected, but right
>> now the backend won't notice until it finishes the query.
> That has the sound of something that might change in the near future? I'd
> love to automatically have runaway queries killed when the client drops the
> connection...
See followup: what was being discussed a couple days ago was cancelling
the query as soon as send() failure is detected. That's not a complete
solution, since there's still a problem with the sort of query that
computes for hours before it tries to emit any output. But it'd be a
big improvement.
Note that since 7.0 or so you can kill a runaway query harmlessly by
sending the backend a SIGINT, even if the client has disconnected.
regards, tom lane