Search Postgresql Archives

Problem Dropping a Database with users connected to it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm basically trying to do what the subject says, through various means
with no success. The basic situation is that every night we recreate our
development database with a complete copy of our live data. The problem
is some of the developers (well me especially) leave open connections to
the DB at night, so the database drop fails. Now that's ok, but I need
some sort of alternative... I thought of:

* Disconnecting all other users before dropping the db, but that doesn't
seem possible (I could start and stop the db, but that doesn't stop any
clients from just reconnecting right away).

* Some sort of idle time disconnection. Postgres doesn't seem to support
this.

* Just drop all the tables, etc. instead of dropping the db. There
doesn't seem to be a good way to do this except doing an explicit DROP
TABLE foo on all 200 tables. Is there a good recipe for this, an easy
way to get a listing of all the tables in a db?

Can anyone suggest an approach I missed or enlighten me on how to
accomplish one of the above. Thanks very much.

-- 
Eric Dorland
eric.dorland@xxxxxxxxx
WCG
514.398-5023 ext. 09562


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux