简体   繁体   中英

Does PostgreSQL version 10 support pgRouting version 2.6?

I installed pgRouting version 2.6 through brew and I have PostgreSQL version 10.4. Now I have question: does this PostgreSQL version support pgRouting extension or not? Because every time I query:

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);

This query fails and give error message:

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

That function is outdated and removed from the core since version 2.0; you want to use one of the current collection of routing functions, eg

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
     );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM