postgres=# DROP DATABASE template_postgis;
ERROR: cannot drop a template database
http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html使它看起来像是如果我设置template_postgis.datistemplate = false
,我将能够放弃它,但我不知道如何设置它。如何从PostgreSQL中删除模板数据库?
我看着在我使用的脚本创建的模板。有一行'psql -d postgres -c'UPDATE pg_database SET datistemplate ='true'WHERE datname ='template_postgis';“'。 – dbkaplun 2012-07-09 03:35:02
这会导致更多问题。我在ubuntu上从9.1 - > 9.2进行了升级。这隐含地创建了template1。然后我执行你的命令,它似乎工作。然而,现在我安装了phpPgAdmin,但我无法登录,它说:'致命:数据库'template1'不存在' – hek2mgl 2014-01-13 11:47:46
重新创建template1: 'create database template1 template template0;' 'UPDATE pg_database SET datistemplate ='true 'WHERE datname ='template1';' 另请参阅:http://pgsql.inb4.se/2009/april/rebuild-template1.html – 2015-07-30 06:00:12