Sql Postgis功能不是唯一的
我正在尝试,在尝试创建空间对象时出错。误差是Sql Postgis功能不是唯一的,sql,postgresql,drupal,postgis,cartaro,Sql,Postgresql,Drupal,Postgis,Cartaro,我正在尝试,在尝试创建空间对象时出错。误差是 Unable to parse WKT: POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316)) 查看postgres日志,我发现数据库错误是 ERROR: function st_geometrytype(unknow
Unable to parse WKT: POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))
查看postgres日志,我发现数据库错误是
ERROR: function st_geometrytype(unknown) is not unique at character 8
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
STATEMENT: SELECT ST_GeometryType('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))'), ST_IsValid('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))'), ST_IsValidReason('POLYGON((2323165.9017765 -3715665.1528316,2325153.2645117 -3715818.0268882,2323471.6498896 -3717652.5155667,2323165.9017765 -3715665.1528316))') as reason
如果我尝试手动运行该语句的简化版本,我会
# SELECT ST_GeometryType('POINT(10 10)');
ERROR: function st_geometrytype(unknown) is not unique
LINE 1: SELECT ST_GeometryType('POINT(10 10)');
^
HINT: Could not choose a best candidate function. You might need to add explicit type casts.
但是,
# SELECT ST_GeometryType(ST_GeometryFromText('POINT(10 10)'));
st_geometrytype
-----------------
ST_Point
(1 row)
看起来cartaro的查询是错误的,并且省略了St_GeometryFromText,但是它会有这样一个明显的错误,这似乎很奇怪。这可能与我使用的PostGIS版本(2.1.0)有关,还是这真的只是一个bug
编辑
# \df ST_GeometryType
List of functions
Schema | Name | Result data type | Argument data types | Type
----------+-----------------+------------------+---------------------+--------
public | st_geometrytype | text | geometry | normal
topology | st_geometrytype | text | tg topogeometry | normal
(2 rows)
似乎有两个函数与该名称匹配,是否应删除其中一个?\df ST_GeometryType。。。您看到列出了哪些函数?我看到了两个,一个在公共模式中,一个在拓扑中。看来这就是问题所在!但我该怎么解决呢?我可以删除一个吗?听起来您已经将PostGIS扩展安装到多个架构,或者手动安装了一个扩展。可能是以前PostGIS 1.x安装的延期?不,这是一个新安装,但我在安装拓扑之前遇到了问题,我可能做了一些重复的事情。我只是重新安装了它,确保每一步都只有一个
st_geometry_type
函数。但在安装cartaro之后,第二个出现了。卡塔罗似乎在某种程度上复制它。