How to kill PostgreSQL process/session/connection

In this article, we will see how to kill PostgreSQL process ID step by step. we can kill process id by using the function pg_terminate_backend(). To execute this, we must must have superuser privileges.

Query to kill Postgres Process: Continue reading How to kill PostgreSQL process/session/connection

Query to check blocking in PostgreSQL Server

In this article, we will see query to check blocking in PostgreSQL Server.

Syntax to check blocking PostgreSQL Server:

SELECT datname , usename , wait_event_type , wait_event , pg_blocking_pids(pid) AS blocked_by_pid , query FROM pg_stat_activity WHERE wait_event IS NOT NULL;

Continue reading Query to check blocking in PostgreSQL Server