BUG #16606: V 4.25: unable to drop database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

BUG #16606: V 4.25: unable to drop database

PG Bug reporting form
The following bug has been logged on the website:

Bug reference:      16606
Logged by:          G. Borri
Email address:      [hidden email]
PostgreSQL version: 10.14
Operating system:   ubuntu 18.04 desktop 64bit
Description:        

Hi, after several attempts, I tried the system just started.
So I opened pgAdmin, insert my admin pwd, opened the server tree till the
database I need to delete.
Right click on the db name and then click on Delete/Drop database, then
click on OK on the confirm request.
After some seconds this error appear: The database is in use, there is 1
session client.

Before the last update I was always able to delete the databases in this way

Reply | Threaded
Open this post in threaded view
|

Re: BUG #16606: V 4.25: unable to drop database

Alexander Korotkov-4
Hi!

On Thu, Sep 3, 2020 at 11:46 AM PG Bug reporting form
<[hidden email]> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      16606
> Logged by:          G. Borri
> Email address:      [hidden email]
> PostgreSQL version: 10.14
> Operating system:   ubuntu 18.04 desktop 64bit
> Description:
>
> Hi, after several attempts, I tried the system just started.
> So I opened pgAdmin, insert my admin pwd, opened the server tree till the
> database I need to delete.
> Right click on the db name and then click on Delete/Drop database, then
> click on OK on the confirm request.
> After some seconds this error appear: The database is in use, there is 1
> session client.

Yes, it's not possible to drop the PostgreSQL database, while there is
another session using it.  You can check the session, which uses the
database, by querying pg_stat_activity view.

SELECT * FROM pg_stat_activity WHERE datname = 'postgres' AND pid <>
pg_backend_pid();

> Before the last update I was always able to delete the databases in this way

This behavior wasn't changed in PostgreSQL 10.  But you might be
interested that there is a FORCE option for DROP TABLE [1] in
PostgreSQL 13, which will be released soon.

Links
1. https://www.postgresql.org/docs/13/sql-dropdatabase.html

------
Regards,
Alexander Korotkov