Jun 14 2016

ERROR: database “database_name” is being accessed by other users in PostgreSQL

Category: Administration,Errors and SolutionsFatih Acar @ 08:57

Error

When you execute drop database command, database get an error like ERROR: database “database_name” is being accessed by other users.>

droppostgresqldatabase1

droppostgresqldatabase2

Solution

You have to kill backend process. Firstly, you have fecth backend process.
Select
SQL> SELECT pid,datname FROM pg_stat_activity where pid <> pg_backend_pid();
Kill
SQL> SELECT pg_terminate_backend($pid);

droppostgresqldatabase3

droppostgresqldatabase4

3,118 total views, 4 views today

Tags: PostgreSQL, PostgreSQL Administration

facebook comments:

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.