3 ms·
Depending on how badly the session is misbehaving: http://www.postgresql.org/docs/9.1/static/libpq-cancel.html http://www.postgresql.org/docs/9.1/static/libpq-c
by dkadams 14y ago
Depending on how badly the session is misbehaving: http://www.postgresql.org/docs/9.1/static/libpq-cancel.html http://www.postgresql.org/docs/9.1/static/libpq-cancel.html
or
pg_cancel_backend(pid int) or pg_terminate_backend(pid int)
- deleted 14y ago[deleted]
- DrJokepu 14y agoOh that's very cool, I din't know about that one. I guess this item can be removed from my list.
- fdr 14y agoInternally there is also an interesting mechanism: when one connects, the backend hands you a "backend key", which is a 64 bit number. The client is intended to remember that number. Cancellations are processed by sending a cancel request to the server -- which involves a special new connection and a different first packet -- including that secret number. As an interesting security precaution, absolutely no acknowledgement or response is made to the cancellation request. libpq knows how to do all this. The reason for this is that to avoid inspecting the connection for new instructions during query processing, acting under the assumption that cancellations will be rare. http://www.postgresql.org/docs/9.1/interactive/protocol-flow.html#AEN91658 http://www.postgresql.org/docs/9.1/interactive/protocol-flow...