Add force option to dropdb

Поиск
Список
Период
Сортировка
От salah jubeh
Тема Add force option to dropdb
Дата
Msg-id 1389725607.27627.YahooMailNeo@web122206.mail.ne1.yahoo.com
обсуждение исходный текст
Ответы Re: Add force option to dropdb  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
<div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida
Grande,sans-serif;font-size:10pt">Hello,<br /><br />I think adding a force option to dropdb is usefull for many
purposes,mainly; scripting. For example, in a test enviroment, I restore a daily backup of production databases. The
newlycreated databases are used as templates for development and also for reading, thus replacing them is completly
safe.<br/><br />I uses dropdb and pg_terminate_backend  for this purpose, since some users might forget to close
connections.<br/>I have had a look on dropdb.c and I have amended the code to also terminate client connections using
pg_terminate_backend<br/><br />So the functionallity of the dropdb if force option is used is as follows:<br />1.
Terminateclient connections using pg_terminate_backend<br />2. Drop the database<br /><br />For the sake of
completeness:<br/>1. I think also, I need also to temporary disallow conecting to the database, is that right?<br />2.
Isthere other factors can hinder dropping database?<br /><div style="color: rgb(0, 0, 0); font-size: 13.3333px;
font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent;
font-style:normal;">3. Should I write two patches one for pg_version>=9.2 and one for pg_version<9.2  <br
/></div><divstyle="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica
Neue,Helvetica,Arial,LucidaGrande,sans-serif; background-color: transparent; font-style: normal;"><br /></div><div
style="color:rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida
Grande,sans-serif;background-color: transparent; font-style: normal;">Regards<br /></div></div> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Kara
Дата:
Сообщение: Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: shared memory message queues