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

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Evan Martin *EXTERN*" <postgresql(at)realityexists(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Please make it easy to drop a database that is in use
Date: 2012-06-21 14:04:18
Message-ID: D960CB61B694CF459DCFB4B0128514C20808D690@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Evan Martin wrote:
> Like I said in my original post, I understand the workaround. I just
> think that:
>
> 1) The workaround requires extra work for each developer (or at least
> each client application) using PostgreSQL, while a fix in PostgreSQL
> would solve this once and for all.

For a developer it should not be a problem to write an
auxiliary function that kills the connections and drops the
database.

> 2) The workaround requires superuser privileges, which I don't think
> should be required to drop your own database.

You said that such a feature would be useful for developers.
Developers usually have superuser privileges.
PostgreSQL 9.3 will probably allow you to pg_terminate_backend()
your own sessions even if you are not a superuser, at least there
is such a patch in the queue.

I don't think that saving a few keystrokes for lazy developers
is a good enough reason for such a thing in core.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-21 14:07:09 Re: Please make it easy to drop a database that is in use
Previous Message Raghavendra 2012-06-21 14:01:35 Re: Please make it easy to drop a database that is in use