What is the difference between SESSION_USER and CURRENT_USER in PostgreSQL

In this article, we will see the difference between SESSION_USER and CURRENT_USER in PostgreSQL.

Difference between SESSION_USER and CURRENT_USER in PostgreSQL:
SESSION_USER is the role name of the role that is connected to the database.
Continue reading What is the difference between SESSION_USER and CURRENT_USER in PostgreSQL

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