Closed gnusupport closed 2 years ago
GNU Support writes:
I have noticed that queries that take long time are not interruptible by Emacs. Maybe something can be done on that?
I had to stop server to interrupt it.
Maybe there is some function that can be implemented to send some signal to interrupt it?
A PostgreSQL query needs to be cancelled by opening a second connection to the server an cancelling the still-runing one via a cancel key or select pg_cancel_backend(pid). Not sure if this can be done when an emacs module is busy in a function all, need to investigate...
Meanwhile you can work around it by setting a statement timeout. E.g.
(pq:query nnpq-con "set statement_timeout = '1s'") nil (pq:query nnpq-con "select pg_sleep(2)") (pq:error "ERROR: canceling statement due to statement timeout\n" "57014")
Meanwhile you can work around it by setting a statement timeout. E.g.
(pq:query nnpq-con "set statement_timeout = '1s'") nil (pq:query nnpq-con "select pg_sleep(2)") (pq:error "ERROR: canceling statement due to statement timeout\n" "57014")
Well that is good enough! Please close this.
I have noticed that queries that take long time are not interruptible by Emacs. Maybe something can be done on that?
I had to stop server to interrupt it.
Maybe there is some function that can be implemented to send some signal to interrupt it?