新建数据库提示:
[PostgreSQL] "template1" being accessed by other users
说明该template1模板正在被人连接。我选择的解决方案是:
查询出连接该数据库的进程,并将其杀死(比较暴力)。
select pg_terminate_backend(pid) from pg_stat_activity where DATNAME = 'template1';
本文介绍了一种解决PostgreSQL中template1数据库被其他用户占用的情况。通过查询并终止相关进程的方法来快速释放资源。
2250
2224
4705
1186