database – ERROR:function addgeometrycolumn不是唯一的
发布时间:2020-12-13 16:04:47 所属栏目:百科 来源:网络整理
导读:我正在尝试使用以下功能; SELECT Assign_vertex_id('ways',0.00001,'the_geom','gid') 但由于某种原因,它给了我以下错误; NOTICE: CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "vertices_tmp.id"CONTEXT: SQL stat
我正在尝试使用以下功能;
SELECT Assign_vertex_id('ways',0.00001,'the_geom','gid') 但由于某种原因,它给了我以下错误; NOTICE: CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "vertices_tmp.id" CONTEXT: SQL statement "CREATE TABLE vertices_tmp (id serial)" PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement ERROR: function addgeometrycolumn(unknown,unknown,integer,integer) is not unique LINE 1: SELECT addGeometryColumn('vertices_tmp',4326,'... ^ HINT: Could not choose a best candidate function. You might need to add explicit type casts. QUERY: SELECT addGeometryColumn('vertices_tmp','POINT',2) CONTEXT: PL/pgSQL function "assign_vertex_id" line 24 at EXECUTE statement ********** Error ********** ERROR: function addgeometrycolumn(unknown,integer) is not unique SQL state: 42725 Hint: Could not choose a best candidate function. You might need to add explicit type casts. Context: PL/pgSQL function "assign_vertex_id" line 24 at EXECUTE statement 现在从我发现它必须是旧的PostGIS签名周围.当我运行以下命令; select proname,proargnames from pg_proc where proname = 'addgeometrycolumn'; 结果是这样的; pg_proc returns 6 rows. Three rows with column proargnames returning a blank or (null) value 有人能帮我吗?这与旧的postgis签名有什么关系吗?如果是的话,我该如何解决? 谢谢 解决方法
PostgreSQL支持
function overloading.
对于重载函数(就像你显然那样),只调用文本文字(并且没有显式类型转换)的调用可能是不明确的. 通常,将明确的type casts添加到参数文字可以解决问题.任意的例子: SELECT my_fuc('foo'::text,0.001::numeric,123::int); 在您的情况下,此调用是不明确的: addGeometryColumn('vertices_tmp',2) 请注意以下几点: >所有未加引号的标识符都在Postgres中转换为小写. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |