已安装 PostGIS,但无法 select 版本或添加地理列

PostGIS installed, but unable to select version or add geography columns

我在 Google Cloud 上有一个现有的 Postgres 9.6 数据库,它启用了 PostGIS 扩展,但是每当我尝试创建一个 table 的列时 geography输入或 select PostGIS 版本我收到错误消息。

对于创建 geography 列,错误是非描述性的——只是一个箭头指向以下语句中的单词 geography

create table place(coordinate geography(POINT,4326));

版本错误如下:

select postgis_full_version();
ERROR:  could not access file "$libdir/postgis-2.3": No such file or directory
CONTEXT:  SQL statement "SELECT postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 22 at SQL statement

create extension 语句确认它已经安装,例如

create extension postgis;
error: the extension already exists

我已经尝试 运行 这些命令作为 postgres 用户和另一个被授予对相关数据库的权限的用户,但似乎都不起作用。任何帮助将不胜感激。

它比你想象的要简单: 您的托管提供商搞砸了 PostGIS 安装。

看起来文件 确实 丢失了,或者操作系统级别的其他配置错误。

你应该抱怨 Google。