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

2012-06-21 Thread Evan Martin
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

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

2012-06-21 Thread Tom Lane
Evan Martin 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_s

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

2012-06-21 Thread Albe Laurenz
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 devel

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

2012-06-21 Thread Raghavendra
> > > SELECT pg_terminate_backend(procpid) > FROM pg_stat_activity > WHERE datname = 'dropme'; > > ERROR: must be superuser to signal other server processes > > You can try this approach. http://archives.postgresql.org/pgsql-general/2012-04/msg00100.php --- Regards, Raghavendra EnterpriseDB Corp

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

2012-06-21 Thread Evan Martin
On 21/06/2012 10:20 PM, Sergey Konoplev wrote: On Thu, Jun 21, 2012 at 2:03 PM, Evan Martin wrote: 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. It is not clean what

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

2012-06-21 Thread Sergey Konoplev
On Thu, Jun 21, 2012 at 2:03 PM, Evan Martin wrote: > 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. It is not clean what database you need to reconnect automatically

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

2012-06-21 Thread Evan Martin
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. 2) The workaround requires superuser pr

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

2012-06-20 Thread Sergey Konoplev
On Tue, Jun 19, 2012 at 1:40 PM, Evan Martin wrote: > When I'm developing against a PostgreSQL database I often drop and re-create > it and I often find that the drop fails, because it's "in use by other > users". This is really annoying, especially when I know full well there are > no other users

[GENERAL] Please make it easy to drop a database that is in use

2012-06-19 Thread Evan Martin
Hi All, When I'm developing against a PostgreSQL database I often drop and re-create it and I often find that the drop fails, because it's "in use by other users". This is really annoying, especially when I know full well there are no other users - it's just me. I'm aware of the workaround: