Forcibly disconnect users from one database

Поиск
Список
Период
Сортировка
От Andrus
Тема Forcibly disconnect users from one database
Дата
Msg-id 1C5A3D61BBBE42A38C61C436AEF3C20E@dell2
обсуждение исходный текст
Ответы Re: Forcibly disconnect users from one database
Список pgsql-general
Hi!

Postgres 12 does not allow to drop database if it is in use. DROP DATABASE throws error:

postgres@template1 ERROR:  database "mydb" is being accessed by other users
postgres@template1 DETAIL:  There is 1 other session using the database.
postgres@template1 STATEMENT:  DROP DATABASE "mydb"

How to disconnect all users from database?
Using 

/etc/init.d/postgresql restart  

disconnects users from all databases. How to disconnect users from one database only ?
I looked into pgAdmin 4 but havent found such command. 

pgAdmin 3 had buttons to select kill processes by database name but those disappeared in pgAdmin 4.

How to find which users are using database and forcibly disconnect them ?

Andrus.



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Huge number of pg_temp and pg_toast_temp schemas
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Using of --data-checksums