删除 PostgreSQL 安装期间创建的 3 个默认数据库是否安全?
我使用提供的一键安装程序在 Windows 2003 Server 上安装了 PostgreSQL 8.4 的默认安装。 第一次运行psql -l,我注意到默认安装了三个数据库:postgres、template0和template1< /em>.
出于安全考虑,我的第一反应是删除或更改默认配置。 然而,我也知道我对数据库一无所知(因为这次安装是我自学数据库的第一步),所以我想我应该先问一下。
删除这些安全吗?
I installed a default installation of PostgreSQL 8.4 on Windows 2003 Server, using the one-click installer provided. Running psql -l for the first time, I noticed there are three databases installed by default: postgres, template0, and template1.
Being security-minded, my initial reaction is to delete or change default configurations. However, I also know I haven't a clue regarding databases (as this install is my first step in self-learning about databases), so I thought I would ask first.
Is it safe to delete these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上 - 不。
postgres 数据库在这里作为非模板数据库,可以合理保证它的存在 - 因此任何不知道连接到哪里的脚本都可以连接到那里。
如果您删除 template1 - 您将失去创建新数据库的能力(至少很容易)。
template0 是作为备份,以防你的 template1 损坏。
虽然我理论上可以想象一个没有 template* 和 postgres 数据库的工作数据库,但让我烦恼的是我不知道通过删除它们想要实现什么(安全方面)。
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.
您可以删除 postgres,但不要触摸 template0 或 template1。 postgres 数据库是为了方便起见。
You can delete the postgres but do not touch template0 or template1. The postgres database is there for convenience.