删除 PostgreSQL 安装期间创建的 3 个默认数据库是否安全?

发布于 2024-07-27 13:42:09 字数 280 浏览 3 评论 0原文

我使用提供的一键安装程序在 Windows 2003 Server 上安装了 PostgreSQL 8.4 的默认安装。 第一次运行psql -l,我注意到默认安装了三个数据库:postgrestemplate0template1< /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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绿光 2024-08-03 13:42:09

基本上 - 不。

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.

眼中杀气 2024-08-03 13:42:09

您可以删除 postgres,但不要触摸 template0 或 template1。 postgres 数据库是为了方便起见。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文