Question

Can you tell me how to kill connection in pgadmin 4 web postgresql without executing any scripts?

How can I limit the number of connection to database in order to kill the active connection (My case I want to rename database already used !)

Was it helpful?

Solution

pgAdmin III can show information about all connections by using the Tools > Server Status. This option shows a window with four panes:

  1. Acitivity (showing all connections, with PID, application name, database, user, etc). In this pane, you can select one connection and either Cancel the query or Stop the backend by means of two little orange and red buttons. These correspond to pg_cancel_backend and pg_terminate_backend PostgreSQL function calls.
  2. Locks
  3. Prepared transactions
  4. LogFile

pgAdmin III, when choosing a Database Cluster from the Object Navigator, will show, under the Statistics tab, all connections with their running queries.


pgAdmin 4, on the other hand, does not have a Tools > Server Status menu. Instead, it's got a Dashboard tab, which has the same functionality, except for three things:

  1. The Sessions tab (equivalent to the Sessions pane in pgAdmin III) does not have any buttons. So, the functionality to cancel a backend is by means of the GUI is not there.
  2. THe LogFile functionality is not present. I assume this is due to the new architecture of pgAdmin 4, that works as if you were remotely connecting through a web server, which is supposed to not have access to local files, but only to the database. The database itself writes on the log files, but it does not read from them.
  3. There is also a Configuration tab, shown when selecting the database cluster, showing all values from postgresql.conf (through database calls, I assume).

The statistics tab is also present, with euivalent functionality.


NOTES: Checked on pgAdmin III v 1.22.2 and pgAdmin 4 v 1.4

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top