I'm learning PostGIS and pg_routing to help in our project planning and grant applications at my transportation agency (we wanted to move beyond the limitations of the 1/4 mile walking buffer we use so frequently!).

I have been following underdark's very helpful pg_routing tutorials but am having trouble running the shortest_path function in my own dataset:

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

CREATE TABLE catchment_facilities AS
    (SELECT sum(cost) FROM (
       SELECT * FROM shortest_path('
       SELECT objectid::int8 AS id,
          sweeptime::float8 AS cost
          FROM lionroute',
       false)) AS foo ) AS cost
FROM lionroute_vertices_pgr;

From reading the forums I get the sense that one of my columns is not in the right format, but I can't for the life of me figure out which one ('id' is int8).

  • Thank you @dkastl you were right. The function I was looking for was pgr_dijkstra. I also needed to declare one of my columns as an integer for the function to work
    – ChrisHamby
    Commented Dec 29, 2014 at 21:12

1 Answer 1


You're using an outdated tutorial with the new pgRouting 2.0 release, I guess.

As the error states, it cannot find the function, because the function has been renamed. I recommend you to look at the pgRouting Workshop.

The pgRouting documentation also gives brief examples for every function.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.