我需要安装接地距离,这是Postgresql的一个扩展。它的页面上写着:
地球距离模块为计算地球表面的大圆距离提供了两种不同的方法。首先描述的数据集取决于多维数据集包(在安装接地距离之前必须安装这个包)。第二种是基于内置点数据类型,使用经度和纬度作为坐标。
这似乎是真的..。
dealermade=# CREATE EXTENSION earthdistance FROM unpackaged;
ERROR: required extension "cube" is not installed但是,我也不能安装cube
dealermade=# CREATE EXTENSION cube FROM unpackaged;
ERROR: type "cube" does not exist看起来很尴尬,cube扩展需要它提供的cube类型。我在用PostgreSQL 9.1.1。我正在Ubuntu上做这件事,我已经安装了配套的包postgresql-contrib-9.1。也就是说,我的系统上没有cube.sql。
如果我试图直接安装earthdistance.sql,我会得到以下信息
$ psql -d db -f /usr/share/postgresql/9.1/extension/earthdistance--1.0.sql
CREATE FUNCTION
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:31: ERROR: type "cube" does not exist
CREATE FUNCTION
CREATE FUNCTION
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:49: ERROR: type "earth" does not exist
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:55: ERROR: type earth does not exist
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:61: ERROR: type earth does not exist
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:67: ERROR: type earth does not exist
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:73: ERROR: type earth does not exist
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:79: ERROR: could not access file "MODULE_PATHNAME": No such file or directory
psql:/usr/share/postgresql/9.1/extension/earthdistance--1.0.sql:88: ERROR: function geo_distance(point, point) does not exist发布于 2012-01-04 16:55:21
只有当它已经作为一个控制模块安装时(即从9.0升级),并且您需要将它转换为一个扩展时,才需要使用非打包。因此,只是:
CREATE EXTENSION cube;
CREATE EXTENSION earthdistance;https://serverfault.com/questions/346568
复制相似问题