PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit
PostGIS 2.4.4
pgRouting 2.6.0

and This Tutorial I am trying to run this Query

$conn = pg_connect($conString);
$sql = "SELECT gid, AsText(geom) AS wkt,
           length(geom) AS length, ".TABLE.".id
        FROM ".TABLE.",
            (SELECT gid, geom
                FROM dijkstra_sp_delta(
             ) as rt
        WHERE ".TABLE.".gid=gid;";
$query = pg_query($conn,$sql);

but I am getting this error:

Warning: pg_query(): Query failed: ERROR: function dijkstra_sp_delta(unknown, integer, integer, integer) does not exist LINE 5: FROM dijkstra_sp_delta( ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in D:\wamp64\www\Route\assets\post.php on line 46

What am I doing wrong?

  • Have you defined TABLE?
    – JGH
    Jul 4 '18 at 21:52
  • Hi , thanks for reply, yes I did. I even pass the table name directly victoria and getting same error back
    – Mona Coder
    Jul 4 '18 at 21:55

The tutorial you're trying to follow is from FOSS4G conference in 2007, and pgRouting has changed a lot since then.

You need to update your pgRouting functions to the current version. But more easy would be to start with the pgRouting workshop: https://workshop.pgrouting.org/

  • Thanks for comment but the latest workshops are not using any PHP model!
    – Mona Coder
    Jul 5 '18 at 14:56
  • Yes, but they use the current SQL queries. It shouldn't be too difficult to change apply the new SQL syntax to PHP.
    – dkastl
    Jul 7 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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