相关疑难解决方法(0)

如果有一个活动的连接,如何删除PostgreSQL数据库?

我需要编写一个删除PostgreSQL数据库的脚本.它可能有很多连接,但脚本应该忽略它.

DROP DATABASE db_name当存在打开的连接时,标准查询不起作用.

我该如何解决这个问题?

postgresql

605
推荐指数
10
解决办法
36万
查看次数

如何选择PostgreSQL数据库的活动连接列表

PostgreSQL中是否有命令选择到给定数据库的活动连接?

psql 说我不能删除我的一个数据库,因为它有活动的连接,所以我想看看连接是什么(以及从哪些机器)

sql postgresql database-connection listings

112
推荐指数
5
解决办法
11万
查看次数

Django测试 - 无法删除并重新创建测试数据库

我在Mac OS X上运行Django 1.9,Postgres 9.5.1

我跑的时候 /manage.py test --settings=myproj.settings.local

我明白了:

Creating test database for alias 'default'...
Creating test database for alias 'userlocation'...
Got an error creating the test database: database "test_myproj" already exists

Type 'yes' if you would like to try deleting the test database 'test_myproj', or 'no' to cancel: yes
Destroying old test database for alias 'userlocation'...
Got an error recreating the test database: database "test_myproj" is being accessed by other users
DETAIL:  There is 1 other session using …
Run Code Online (Sandbox Code Playgroud)

python django postgresql postgis

7
推荐指数
2
解决办法
3874
查看次数

如何在 pgadmin 中删除数据库

当我尝试在 pgadmin 4 中创建名为“eCommerce”的其他数据库时,会出现此消息

错误:其他用户正在访问源数据库“template1” 详细信息:还有 2 个其他会话正在使用该数据库。

我尝试删除其他数据库但不起作用并出现

错误:无法删除模板数据库

我该怎么办?

java sql database

4
推荐指数
2
解决办法
7050
查看次数