Is it safe to delete the 3 default databases created during a PostgreSQL install? Is it safe to delete the 3 default databases created during a PostgreSQL install? windows windows

Is it safe to delete the 3 default databases created during a PostgreSQL install?


Basically - no.

postgres database is here as a non-template database with reasonable guarantee that it exists - so any script that doesn't know where to connect to, can connect there.

if you will remove template1 - you will lose the ability to create new databases (at least easily).

template0 is there as a backup, in case your template1 got damaged.

While I can theoretically imagine a working database with no template* and postgres databases, the thing that bugs me is that i have no idea what (security-wise) you want to achieve by removing them.


You can delete the postgres but do not touch template0 or template1. The postgres database is there for convenience.