Using RDS postgresql and terminating other processes

Sometimes it may be necessary to terminate a postgres users process, for example if it were holding a lock an excessive amount of time that is blocking an important process from running.

 select pg_terminate_backend(<pid>);
-- or 
select pg_cancel_backend(<pid>);

Here’s an excellent blog that talks about a number of things related to finding locks, blocking processes, long running queries etc. It talks about a lot of things but it informative:

Leave a Comment

Your email address will not be published. Required fields are marked *