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,我就可以放弃它,但我不知道如何设置它.

推荐答案

postgres=# UPDATE pg_database SET datistemplate='false' WHERE datname='template_postgis';
UPDATE 1
postgres=# DROP DATABASE template_postgis;
DROP DATABASE
postgres=# 

Postgresql相关问答推荐

跳过DLC中的某些类型的 node

有没有方法可以设置postGER中非空列的默认值?

Docker化的PostgreSQL:FATAL:用户&postgres的密码身份验证失败

哪种数据类型是除法的结果?

Postgres SQL:获取列值在连续日期之间已更改的行

在PostGreSQL中获取最近日期的项目

PostgreSQL:在 select 和 group by 中使用不同的列不会导致错误

如何在 kubernetes 中安全地重启 postgresql 容器?

Postgres 唯一 JSON 数组聚合值

Django + Postgres + 大时间序列

Rails Migration 使用转换将字符串转换为整数

Postgres 图像未创建数据库

为什么 SQLAlchemy 不创建串行列?

PostgreSQL如何连接间隔值'2天'

在 PL/pgSQL 中声明行类型变量

无法使用 sequelize 从本地 node 应用程序连接到 heroku postgresql 数据库

如何使用 psql 执行 *.sql 文件

postgresql 查询以显示用户的组

使用 SQLAlchemy 进行 PostgreSQL ILIKE 查询

使用 Postgresql 在过滤器中制作 Sqlalchemy 使用日期