0

我通过 brew 安装了 pgRouting 2.6 版,我有 PostgreSQL 10.4 版。现在我有一个问题:这个 PostgreSQL 版本是否支持 pgRouting 扩展?因为每次我查询:

SELECT * 
FROM shortest_path('SELECT gid AS id, start_id::int4 AS source, end_id::int4 AS target, cost_length::float8 AS cost FROM network', 1, 135, false, false);

此查询失败并给出错误消息:

ERROR:  function shortest_path(unknown, integer, integer, boolean, boolean) does not exist
LINE 1: SELECT * FROM shortest_path('
                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Query failed
4

1 回答 1

0

自 2.0 版以来,该功能已过时并从核心中删除;您想使用当前的路由功能集合之一,例如

SELECT * 
FROM pgr_Dijkstra(
       'SELECT gid AS id,
               start_id::int4 AS source,
               end_id::int4 AS target,
               cost_length::float8 AS cost
        FROM network',
       1,
       135,
       false
     );
于 2018-06-08T14:57:50.150 回答