创建扩展 postgis 失败,

nis*_*tan 9 postgresql postgis

Ubuntu 18.04psql (PostgreSQL) 12.2 (Ubuntu 12.2-2.pgdg18.04+1)

运行temba=# create extension postgis;失败并出现以下错误

ERROR:  could not open extension control file "/usr/share/postgresql/10/extension/postgis.control": No such file or directory
Run Code Online (Sandbox Code Playgroud)

我跑了find /usr -name postgis.control才发现postgis.control是在一个名为12而不是10

laptop@xyz-x:~$ find /usr -name postgis.control
/usr/share/postgresql/12/extension/postgis.control
Run Code Online (Sandbox Code Playgroud)

编辑 1

我已经跑了 sudo apt-get install postgis

Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgis is already the newest version (3.0.1+dfsg-2.pgdg18.04+1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

nis*_*tan 18

我运行了这个sudo apt install postgis postgresql-10-postgis-2.5并且它起作用了


小智 7

我不确定我需要什么版本的 postgres 或 postgis,所以我找到了sudo apt install postgis postgresql-postgis工作。

它要么给了我最新的,要么匹配了我安装的 postgres 版本。