In order to kill a process in PostgreSQL, we type the following command in psql or your favourite database manager application:

SELECT pg_terminate_backend(500); -- 500 is the process number.