postgresql – template0和template1数据库意外丢失
发布时间:2020-12-13 18:09:39 所属栏目:百科 来源:网络整理
导读:我不知道是否需要template0和template1数据库模板才能创建空数据库.我删除它们是为了清理postgres.现在我无法创建任何新数据库.给我这个错误: ERROR: template database "template1" does not exist 我该怎样做才能让事情再次发生.我会非常感谢任何帮助. 幸
我不知道是否需要template0和template1数据库模板才能创建空数据库.我删除它们是为了清理postgres.现在我无法创建任何新数据库.给我这个错误:
ERROR: template database "template1" does not exist 我该怎样做才能让事情再次发生.我会非常感谢任何帮助.
幸运的是我保留了postgres数据库,因为postgres用户需要登录到psql.因此,创建了template0和template1数据库:
create database template0 TEMPLATE postgres; 和template1相同.然后执行: update pg_database set datistemplate=true where datname='template0'; 两个数据库都阻止我自己再次意外删除这些模板. 现在一切正常:) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Flex SDK编译Stage3D注意事项
- React + Redux + react router技术栈架构
- React框架实现移动页面翻译是一种什么体验?
- 浅谈c++ vector和map的遍历和删除对象
- ORA-12514: Listener Does Not Currently Know of Service
- libvirt XML文件启动qemu 使用hugepages vhost总结
- PostgreSQL启动过程中的那些事十二.五:启动系统日志进程sy
- react-router – 如何使用React VR与React VR进行反应?
- 110个oracle常用函数总结
- Cocos2d-x_常见游戏引擎框架中的模块