dbk*_*lun 49 postgresql database-template postgresql-9.1
postgres=# DROP DATABASE template_postgis;
ERROR: cannot drop a template database
Run Code Online (Sandbox Code Playgroud)
http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html看起来好像我设置了template_postgis.datistemplate = false,我可以放弃它,但我不知道如何设置.
dbk*_*lun 77
postgres=# UPDATE pg_database SET datistemplate='false' WHERE datname='template_postgis';
UPDATE 1
postgres=# DROP DATABASE template_postgis;
DROP DATABASE
postgres=#
Run Code Online (Sandbox Code Playgroud)
Vyn*_*kie 15
您可以使用alter database命令.比沮丧的元数据更简单,更安全.
postgres=# create database tempDB is_template true;
CREATE DATABASE
postgres=# drop database tempDB;
ERROR: cannot drop a template database
postgres=# alter database tempDB is_template false;
ALTER DATABASE
postgres=# drop database tempDB;
DROP DATABASE
postgres=#
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23159 次 |
| 最近记录: |