Interrompre une requête PostgreSQL trop longue.
# ./manage.py dbshell (1)
DB_NAME=> SELECT * FROM pg_stat_activity WHERE state = 'active'; (2)
DB_NAME=> SELECT pg_cancel_backend(<pid of the process>); (3)
| 1 | If you are working on a Django project, else check : here. |
| 2 | This will output a description of currently processed queries, their PID is the 3rd field. |
| 3 | This tries a gracefull stop, if it is still to long to stop try SELECT pg_terminate_backend(<pid of the process>); |
Discorvered here : https://stackoverflow.com/a/35319598