pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: Jie Liang <jliang@ipinc.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Cannot drop database that is in use (NOT)
Date: Tue, 3 Jul 2001 16:04:01 +0100
Message-ID: <01070316040102.03765@gary.ringways.co.uk> (raw)
In-Reply-To: <Pine.BSF.4.10.10107021144450.33518-100000@tidal.ipinc.com>
References: <Pine.BSF.4.10.10107021144450.33518-100000@tidal.ipinc.com>

On Monday 02 July 2001  7:46 pm, Jie Liang wrote:
> what's in your script??
>

[revcom@curly revcom]$ more bin/recreate
#!/bin/bash
 
dropdb revcom
createdb revcom
psql <schema.sql

Doing 'apactrl graceful' did the trick, but a way where I don't need to gain 
access to the web server would be nice.

Gary
>
> Jie LIANG
>
> St. Bernard Software
>
> 10350 Science Center Drive
> Suite 100, San Diego, CA 92121
> Office:(858)320-4873
>
> jliang@ipinc.com
> www.stbernard.com
> www.ipinc.com
>
> On Mon, 2 Jul 2001, Gary Stainburn wrote:
> > 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
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster

-- 
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: <01070316040102.03765@gary.ringways.co.uk>
Permalink:  ../01070316040102.03765@gary.ringways.co.uk/
Also on:    postgresql.org/message-id/01070316040102.03765@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, jliang@ipinc.com
  Subject: Re: Cannot drop database that is in use (NOT)
  In-Reply-To: <01070316040102.03765@gary.ringways.co.uk>
  References: <Pine.BSF.4.10.10107021144450.33518-100000@tidal.ipinc.com> <01070316040102.03765@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