On 22/06/2012 12:07 AM, Tom Lane wrote:
>> 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.
>
Good to hear there's a patch coming for that. Just to be clear, I'm not
suggesting DROP DATABASE should do that by default. Basically, I'm
looking for the "--force" option here - a way to say "I know what I'm
doing, just drop this database if at all possible".
"rm -rf" is a foot gun, too, but if that -f wasn't there you would have
to write commands to set permissions on files when you couldn't care
less about the permissions and just want to delete them. Sure, a
competent Linux user could write such a command, but imagine how
annoying it would be to do that all the time! Not to mention the extra
room for errors in that command. To me, DROP DATABASE is a very similar
case.
Regards,
Evan