【问题标题】:Why shouldn't PostGIS be installed in the PostgreSQL database "postgres"?为什么不应将 PostGIS 安装在 PostgreSQL 数据库“postgres”中?
【发布时间】:2016-03-17 19:36:15
【问题描述】:

PostGIS installation documentation 内容如下:

PostGIS 是一个可选扩展,必须在您要使用它的每个数据库中启用它,然后才能使用它。安装软件只是第一步。不要在名为 postgres 的数据库中安装它。

我们在 Docker 中运行 PostgreSQL,并且只需要一个数据库,因此我们一直使用默认数据库 postgres。我的第一个想法是在那里安装 PostGIS,但文档似乎很清楚我们不应该这样做。

是否有理由不将 PostGIS 安装在默认数据库上,或者此说明是为了防止人们在数据位于 foobar 数据库中时意外将 PostGIS 安装在 postgres 数据库中?

谢谢!

【问题讨论】:

  • 你的数据也在postgres数据库中吗?如果是这样,那升级会不会很困难?

标签: database postgresql postgis


【解决方案1】:

将 PostGIS 安装到 postgres 数据库中没有危险。该注释只是为了让用户不要像您所怀疑的那样混淆自己。

【讨论】:

  • 也许,但如果是这样,则应更新注释以提供准确的信息。例如:please install postgis in a dedicated schema in order to prevent data corruption。或:we recommend installing postigs in a dedicated "postgis" schema, though installation would technically succeed in any dedicated schema。顺便说一句,我猜想在公共模式中安装 postgis,而在另一个模式中安装数据也是不好的做法,因为用户可能会错误地在公共模式中创建表。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-09
  • 1970-01-01
  • 2014-05-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多