Skip site navigation (1) Skip section navigation (2)

Re: Dropping Old Databases

From: Selena Deckelmann <selenamarie(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pdxpug(at)postgresql(dot)org
Subject: Re: Dropping Old Databases
Date: 2009-02-03 01:11:21
Message-ID: 2b5e566d0902021711p68352917yb90b87eda0df18fe@mail.gmail.com (view raw or flat)
Thread:
Lists: pdxpug
On Mon, Feb 2, 2009 at 5:05 PM, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
>  I'm trying to set up TinyERP which uses postgres as a back end (the first
> CRM I've found that does so). The docs are non-existent, so I'm working
> trial-and-error.
>
>  Anyway, I have a few empty databases that were created long ago and I
> cannot drop them. When I try to I see this:
>
> [rshepard(at)salmo ~]$ dropdb contacts
> dropdb: database removal failed: ERROR:  database "contacts" is being
> accessed by other users
> [rshepard(at)salmo ~]$ dropdb eiabusiness
> dropdb: database removal failed: ERROR:  database "eiabusiness" is being
> accessed by other users
>
>  Since I'm the only human user on this system, I've no idea what "other
> users" are currently accessing those dbs.
>
>  What do I need to do to drop them?

Look at your process table (using 'ps' or the equivalent on your
operating system) or pg_stat_activity and see if you have open
connections to those databases.  And, then you probably should kill
off those processes (just use normal kill, not kill -9).  Then you can
drop the tables.

-selena


-- 
Selena Deckelmann
Open Source Bridge - http://www.opensourcebridge.org
PDXPUG - http://pugs.postgresql.org/pdx
Me - http://www.chesnok.com/daily

In response to

Responses

pdxpug by date

Next:From: Rich ShepardDate: 2009-02-03 01:23:24
Subject: Re: Dropping Old Databases
Previous:From: Rich ShepardDate: 2009-02-03 01:05:37
Subject: Dropping Old Databases

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group