How does one drop a template database from PostgreSQL?

后端 未结 3 401
小鲜肉
小鲜肉 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:27

    update pg_database set datistemplate=false where datname='template0';
    update pg_database set datistemplate=false where datname='template1';
    
    ....
    
    Creating script to analyze new cluster                      ok
    Creating script to delete old cluster                       ok
    Checking for hash indexes                                   ok
    
    Upgrade Complete
    ----------------
    

提交回复
热议问题