2014-10-31 49 views
0

我試圖使用查詢如下襬脫mover_location表最近的人:的PostgreSQL數據庫的功能不工作

select * from mover_location where 
public.st_dwithin(public.st_geogfromtext('SRID=4326;POINT(11.2565999 75.7711587)'), 
last_seen_location_geog, 1060) 

這是不工作,並給我的錯誤就像如下:

ERROR: function _st_expand(public.geography, double precision) does not exist 

我沒有調用st_expand函數,我該如何解決這個問題,或者是否有任何其他

解決方法?謝謝 。

我mover_location表結構如下,這裏last_seen_location_geog是地理類型的

enter image description here

更新: -

HINT: No function matches the given name and argument types. You might need to add explicit type casts. 
QUERY: SELECT $1 && _ST_Expand($2,$3) AND $2 && _ST_Expand($1,$3) AND _ST_DWithin($1, $2, $3, true) 
CONTEXT: SQL function "st_dwithin" during inlining 
+2

您使用的是什麼版本的Postgis?這是相關的,因爲ST_DWithin函數有各種形式,它們是以不同的版本引入的,並不是所有的形式都支持地理數據類型,其中一種形式內部使用ST_Expand。 – 2014-10-31 14:22:42

+0

你是如何安裝PostGIS的? – 2014-11-01 08:43:22

+0

我安裝了包含pgadminIII,postgis和stackbuilder的企業數據庫完整軟件包,我不知道postgis的確切版本,但它安裝爲postgresql版本9.3 – Crazyrubixfan 2014-11-01 16:08:48

回答

0

添加公共模式,以您的SEARCH_PATH:

set search_path to your_schema, public;

+0

好吧先前已解決,該問題未安裝postgis擴展 – Crazyrubixfan 2015-03-19 12:29:43