Re: dropdb: database removal failed: ERROR: database "database_name" is being accessed by other users - Mailing list pgsql-admin

From Gourish Singbal
Subject Re: dropdb: database removal failed: ERROR: database "database_name" is being accessed by other users
Date
Msg-id 674d1f8a050222214138bc53b9@mail.gmail.com
Whole thread Raw
In response to dropdb: database removal failed: ERROR: database "database_name" is being accessed by other users  (Gourish Singbal <gourish@gmail.com>)
List pgsql-admin
Guys,

postgres :  7.4.5
Os: linux

I need to restore my back up database with production data.
the steps i follow on backup database are:-
1) dropdb
2) createdb
3) psql or pg_restore to import data into the backup database.

Am i doing the correct steps?.

Problems:-
If some clients are connected to the backup database during the 1st
Step (dropdb)
the postmaster throws an error saying clients connected cannot drop database.

Any solution to the above problem would be great...

regards
gourish


On Mon, 21 Feb 2005 19:51:10 +0530, Gourish Singbal <gourish@gmail.com> wrote:
> This Error message was given when i was dropping the database.
> There are idle connections to the database as seen from ps -ef | grep postgres
>
> How can i drop the database with out restarting the postgres server.?.
>
> FYI: i am dropping the database to perform restoration of this backup
> database using psql  from production.
>
> --
> Best,
> Gourish Singbal
>


--
Best,
Gourish Singbal

pgsql-admin by date:

Previous
From: "Aufkleber24.de"
Date:
Subject: Re: Upgrading 7.3 -> 7.4.5
Next
From: "Sander Steffann"
Date:
Subject: Re: 64 bit rpms for 7.4.7??