Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have my roads and locations added into my PostGis DB, and have installed pgRouting's SQL files. However, when I attempt to run:

SELECT * FROM shortest_path('
   SELECT gid AS id, 
          start_id::int4 AS source, 
          end_id::int4 AS target, 
          shape_leng::float8 AS cost
   FROM myr_roads_point',
1,
5110,
false,
false);

It gives me the following error:

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.

********** Error **********

ERROR: function shortest_path(unknown, integer, integer, boolean, boolean) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 15

Any idea?

share|improve this question
    
Your error hints that you haven't installed pgrouting.Can you confirm the validity of your installation? pgrouting.org/docs/1.x/install.html –  nickves Sep 23 '12 at 9:58
    
The steps is for Linux, whereas I'm running on Windows... So I'm not too sure I have it installed properly..? –  user10405 Sep 23 '12 at 11:33
add comment

3 Answers

Check your PostgreSQL version, because pgRouting does not work with versions after 8.4.

share|improve this answer
    
There is support for 9.1 version. check this link workshop.pgrouting.org/chapters/installation.html –  M-T-A Feb 4 at 11:48
add comment

If you still having that problem check out this link: http://www.bostongis.com/?content_name=pgrouting_osm2po_1#305 I have used the latest binary of pgrouting - it has more explanation what to do. Also to test the capabilities of db - copy SQL stat from the QGIS error and execute as a SQL.

share|improve this answer
add comment

As 'nickves' commented, maybe you haven't loaded the pgRouting functions into your database.

I don't know exactly where the files containing the functions are located on Windows, but the file names should be the same as described in the workshop.

You can easily load them with pgAdmin3 for example.

You can either check if the functions exists by looking into the public schema of your database using pgAdmin3, or with \df shortest_path command in the psql shell.

share|improve this answer
    
Nope - Shortest_path is not inside- but i can see other functions like dijkstra_sp, shootingstar_ap, etc, which means that the pgRouting SQL has already been ran on my DB, but for some reason did not create the Shortest_path... I also noticed that there is 3 DLL files as part of the pgRouting download, and I placed it under C:\Program Files (x86)\PostgresPlus\9.0SS\lib (cos the documentation didn't state where I should put the files...) –  user10405 Sep 23 '12 at 13:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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