How does one drop a template database from PostgreSQL?

后端 未结 3 437
小鲜肉
小鲜肉 2021-01-30 12:33
postgres=# DROP DATABASE template_postgis;
ERROR:  cannot drop a template database

http://www.postgresql.org/docs/9.1/static/manage-ag-templatedbs.html

3条回答
  •  时光取名叫无心
    2021-01-30 13:25

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

提交回复
热议问题