Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

database is being accessed by other users

SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'database_name'
  AND pid <> pg_backend_pid();
Comment

database is being accessed by other users

SELECT pid, pg_terminate_backend(pid) 
FROM pg_stat_activity 
WHERE datname = current_database() AND pid <> pg_backend_pid();
Comment

PREVIOUS NEXT
Code Example
Shell :: directory structure 
Shell :: ssh rsa pub to pem 
Shell :: env variables list 
Shell :: linux change user in terminal 
Shell :: git clone in ubuntu 
Shell :: ubuntu timestamp 
Shell :: add user to dockerfile 
Shell :: tailwind vite 
Shell :: django install pathlib 
Shell :: revert commit git 
Shell :: linux how to free memory 
Shell :: install mysql in debian 
Shell :: how to install morgan in node js 
Shell :: pip install pytorch windows 
Shell :: how to start mongodb server in ubuntu 
Shell :: git change branch remote 
Shell :: installing k3d 
Shell :: kubernetes while true sleep 
Shell :: uninstall your phone app windows 10 
Shell :: how to install mongoose globally 
Shell :: ssh-copy-id example 
Shell :: github command 
Shell :: how to install terraform on Ubuntu/Debian 
Shell :: uniq bash sort 
Shell :: git ignore by file extension 
Shell :: generate ssh key 
Shell :: install unrar linux 
Shell :: replace delimiter for new line 
Shell :: install termius ubuntu 
Shell :: disable iptables debian 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =