Re: Please make it easy to drop a database that is in use
| От | Tom Lane |
|---|---|
| Тема | Re: Please make it easy to drop a database that is in use |
| Дата | |
| Msg-id | 24795.1340287629@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Please make it easy to drop a database that is in use (Evan Martin <postgresql@realityexists.net>) |
| Ответы |
Re: Please make it easy to drop a database that is in use
|
| Список | pgsql-general |
Evan Martin <postgresql@realityexists.net> writes:
> That's a fair point, so perhaps DROP DATABASE should still fail if the
> /current/ connection is to that database (preferably with a helpful
> error like "you cannot drop the database you are connected to").
It does that.
> SELECT pg_terminate_backend(procpid)
> FROM pg_stat_activity
> WHERE datname = 'dropme';
> ERROR: must be superuser to signal other server processes
As far as that goes, there's a pending patch to reduce the privileges
required to use pg_terminate_backend. I'm not in favor of having DROP
DATABASE do it for you though --- that just seems like a very
large-caliber foot gun.
regards, tom lane
В списке pgsql-general по дате отправления: