【问题标题】:PostGIS is installed in Cloud SQL but cannot find PostGIS_full_version()PostGIS 已安装在 Cloud SQL 中,但找不到 PostGIS_full_version()
【发布时间】:2019-10-23 17:14:24
【问题描述】:

我使用 CREATE EXTENSION postgis WITH SCHEMA database 创建了 postgis 扩展。

扩展名存在于扩展名列表中 (SELECT * FROM pg_extension)

postgis 版本 2.5.1。

但选择 PostGis 版本 (SELECT PostGIS_full_version();) 无法正常工作。

ERROR:  function postgis_full_version() does not exist
LINE 1: SELECT PostGIS_full_version();

我正在使用谷歌云。

怎么了?我该如何解决?

【问题讨论】:

标签: postgresql google-cloud-platform postgis google-cloud-sql


【解决方案1】:

CREATE EXTENSION postgis WITH SCHEMA database

如果你想使用非默认架构,比如foo,那么你需要调用select foo.postgis_full_version()

但您可能根本不想指定架构。在 PostgreSQL 中,所有函数调用默认为 public 模式,除非您另外指定。所以select postgis_full_version()select public.postgis_full_version() 是一样的。

尝试运行:

CREATE EXTENSION postgis;

【讨论】:

  • 在搜索路径中有架构就足够了
  • 对,默认只有public在搜索路径中。
【解决方案2】:

问题可能与 PostGIS 2.5 版有关。据官方documentation 称,Google Cloud SQL 支持 PostGIS 2.3 扩展系列。安装说明可以找到here

【讨论】:

    猜你喜欢
    • 2017-09-06
    • 2014-09-30
    • 2021-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-16
    • 2018-03-01
    • 2014-01-16
    相关资源
    最近更新 更多