pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Cannot drop database that is in use (NOT)
Date: Mon, 2 Jul 2001 16:04:46 +0100
Message-ID: <01070216044601.02332@gary.ringways.co.uk> (raw)

Hi all,

I'm developing a database and have a small shell script that drops the 
database, creates it, and then feeds psql to create the tables etc.

I've tried to run it and get the following error:
[revcom@curly revcom]$ recreate
ERROR:  DROP DATABASE: Database "revcom" is being accessed by other users
dropdb: database removal failed
ERROR:  CREATE DATABASE: database "revcom" already exists
createdb: database creation failed
ERROR:  Relation 'teams_tid_seq' already exists
ERROR:  Relation 'members_mid_seq' already exists
blah blah....

I know that there is nobody using the database, so I can only assume it is 
some left-over garbage from my first every php script (as I don't know how to 
close the link openned by pg_pconnect).

How do I close any pending connections and reset the usage count so that I 
can drop the database?

--
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     



view thread (5+ messages)  latest in thread

Message-ID: <01070216044601.02332@gary.ringways.co.uk>
Permalink:  ../01070216044601.02332@gary.ringways.co.uk/
Also on:    postgresql.org/message-id/01070216044601.02332@gary.ringways.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: gary.stainburn@ringways.co.uk
  Subject: Re: Cannot drop database that is in use (NOT)
  In-Reply-To: <01070216044601.02332@gary.ringways.co.uk>
  References: <01070216044601.02332@gary.ringways.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox