[mapserver-users] postgis layer - postgresql table join eror

surahman putra surahmanputra at gmail.com
Mon Aug 13 20:23:57 PDT 2012


I have change the SQL to this one:

SELECT  "Pipeline".the_geom AS the_geom,
        "Pipeline".gid AS gid,
        "Pipeline".status AS status,
        "Kondur_block".id_wk AS id_wk
FROM    "Pipeline"
LEFT JOIN "Kondur_block"
ON     "Pipeline".id_wk = "Kondur_block".id_wk

and it works on psql, but when I tried that SQL to map file, it give me
this message:

msDrawMap(): Image handling error. Failed to draw layer named 'Pipeline'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
syntax error at or near "Pipeline" LINE 1:
...e(ST_AsBinary(ST_Force_2D("the_geom FROM (SELECT "Pipeline".... ^

What I am missing on my mapfile? here is my mapfile :
    CONNECTIONTYPE postgis
    CONNECTION "dbname='Melibur' host=localhost port=5432 user=' '
password=' ' sslmode=disable"
    DATA 'the_geom FROM (SELECT "Pipeline".the_geom AS the_geom,
 "Pipeline".gid AS gid, "Pipeline".status AS status, "Kondur_block".id_wk
AS id_wk FROM "Pipeline" LEFT JOIN "Kondur_block" ON "Pipeline".id_wk =
"Kondur_block".id_wk) as subquery USING UNIQUE gid USING srid=32648'


Thanks,
Surahman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120814/df3e0895/attachment.html>


More information about the mapserver-users mailing list