解决方法
1)查询是哪些连接使用了,用shell 连接到服务器 杀掉进程
select procpid,* from pg_stat_activity where DATNAME='template1';
连接到服务器 kill 掉进程 kill -9 13395
再创建就可以创建成功了
2) 创建数据库时指定template
create database 数据库 owner 数据库用户 ENCODING 'UTF-8' template=template0;
解决方法
1)查询是哪些连接使用了,用shell 连接到服务器 杀掉进程
select procpid,* from pg_stat_activity where DATNAME='template1';
连接到服务器 kill 掉进程 kill -9 13395
再创建就可以创建成功了
2) 创建数据库时指定template
create database 数据库 owner 数据库用户 ENCODING 'UTF-8' template=template0;