I have some users making test on the DB and making some big functions that may contains bugs like inifite loops (with some bad triggers for examples).

For the moment, when a user launch such queries, the only way I found to stop it is to use the kill on all the pid that are allowed to this user, without being able to know wich queries cause the problem (in a transaction).

So I have two questions:

- Is there a way to know what is doing each process of a user
- Is there a cleaner way to disconnect a user or to stop a process than using the kill command.