Problem Dropping a Database with users connected to it
От | Eric Dorland |
---|---|
Тема | Problem Dropping a Database with users connected to it |
Дата | |
Msg-id | 1105719377.7029.24.camel@garuda.wcg.mcgill.ca обсуждение исходный текст |
Ответы |
Re: Problem Dropping a Database with users connected to it
Re: Problem Dropping a Database with users connected to it Re: Problem Dropping a Database with users connected to it |
Список | pgsql-general |
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@mcgill.ca WCG 514.398-5023 ext. 09562
В списке pgsql-general по дате отправления: