gpt4 book ai didi

postgresql - 已安装postgis但无法创建扩展: ERROR: could not open extension control file ~/postgis.控件": No such file or directory

转载 作者:行者123 更新时间:2023-12-03 16:50:24 62 4
gpt4 key购买 nike

我正在使用 ubuntu 18.0.4 并且我有一个 postgresql 数据库。显然我已经安装了postgresql。我也已经安装了postgis:

sudo apt install postgis postgresql-11-postgis-2.5

通过使用这个命令:
dpkg -l | grep postgresq

它返回:
ii  pgdg-keyring                          2018.2                                          
all keyring for apt.postgresql.org
ii postgresql 12+210.pgdg18.04+1
all object-relational SQL database (supported version)
ii postgresql-11 11.6-1.pgdg18.04+1
amd64 object-relational SQL database, version 11 server
ii postgresql-11-postgis-2.5 2.5.3+dfsg-2.pgdg18.04+1
amd64 Geographic objects support for PostgreSQL 11
ii postgresql-11-postgis-2.5-scripts 2.5.3+dfsg-2.pgdg18.04+1
all Geographic objects support for PostgreSQL 11 -- SQL scripts
ii postgresql-12 12.1-1.pgdg18.04+1
amd64 object-relational SQL database, version 12 server
ii postgresql-client-11 11.6-1.pgdg18.04+1
amd64 front-end programs for PostgreSQL 11
ii postgresql-client-12 12.1-1.pgdg18.04+1
amd64 front-end programs for PostgreSQL 12
ii postgresql-client-common 210.pgdg18.04+1
all manager for multiple PostgreSQL client versions
ii postgresql-common 210.pgdg18.04+1
all PostgreSQL database-cluster manager
ii postgresql-contrib 12+210.pgdg18.04+1
all additional facilities for PostgreSQL (supported version

并使用此命令:
dpkg -l | grep postgis

它返回:
ii  postgis                               3.0.0+dfsg-2~exp1.pgdg18.04+1                   
amd64 Geographic objects support for PostgreSQL
ii postgresql-11-postgis-2.5 2.5.3+dfsg-2.pgdg18.04+1
amd64 Geographic objects support for PostgreSQL 11
ii postgresql-11-postgis-2.5-scripts 2.5.3+dfsg-2.pgdg18.04+1
all Geographic objects support for PostgreSQL 11 -- SQL scripts

但是当我尝试创建扩展时:
CREATE EXTENSION postgis;

它引发了这个错误:

ERROR: could not open extension control file >"/usr/share/postgresql/12/extension/postgis.control": No such file or directory



为什么我在安装完所有东西后无法创建此扩展程序?

最佳答案

您为 PostgreSQL v11 安装安装了 PostGIS,但是当您尝试创建扩展时,您已连接到 v12 数据库。

您必须连接到 v11 数据库或为 v12 安装安装 PostGIS。

关于postgresql - 已安装postgis但无法创建扩展: ERROR: could not open extension control file ~/postgis.控件": No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59152649/

62 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com