Search Postgresql Archives

Re: Please make it easy to drop a database that is in use

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

 



Evan Martin <postgresql@xxxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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