How does one drop a template database from PostgreSQL?
问题 postgres=# DROP DATABASE template_postgis; ERROR: cannot drop a template database http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html makes it seem like if I set template_postgis.datistemplate = false , I'll be able to drop it, but I don't know how to set that. 回答1: postgres=# UPDATE pg_database SET datistemplate='false' WHERE datname='template_postgis'; UPDATE 1 postgres=# DROP DATABASE template_postgis; DROP DATABASE postgres=# 回答2: You can use the alter database command.