Re: Droping a database even if someone is connected - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Droping a database even if someone is connected
Date
Msg-id 1047798520.8983.202.camel@linda.lfix.co.uk
Whole thread Raw
In response to Droping a database even if someone is connected  (Eric Audet <eaudet@scc.ca>)
Responses Re: Droping a database even if someone is connected  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, 2003-03-13 at 19:19, Eric Audet wrote:
> Is there a way to drop a database even if someone is connected to it?
>
> I use a perl script that
> 1) drop the database, (dropdb)
> 2) create a new database, (createdb)
> 3) restore a database from a dump (psql databasename <dumpfile)
>
> When the drop does not work, everything else fails!

If 1) fails, identify the relevant backend process and kill it. Then try
again.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Bless them which persecute you; bless, and curse not.
      Rejoice with them that do rejoice, and weep with them
      that weep. Recompense to no man evil for evil. Provide
      things honest in the sight of all men."
                                  Romans 12:14,15,17


pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: socket error
Next
From: "shreedhar"
Date:
Subject: Re: query optimisation