Maserver4.8beta1: error in postgis layer query

Stefano B. stefano.bonnin at COMAI.TO
Wed Nov 9 02:54:25 EST 2005


Hi,

I have just installed the new 4.8beta code and the postgis query give me a syntax problem.
My query is the following:

the_geom from (SELECT the_geom,gid,type,name from places WHERE site_id = 1 and layer = 'lyr_53') as foo USING UNIQUE gid USING srid=-1

and follow the mapserver error:

Error executing POSTGIS DECLARE (the actual query) statement: "DECLARE mycursor BINARY CURSOR FOR SELECT type::text,name::text,asbinary(force_collection(force_2d(the_geom)),"NDR"),gid::text from (SELECT the_geom,gid,type,name from places WHERE site_id = 1 and layer = "lyr_53") as foo USING UNIQUE gid WHERE the_geom && setSRID("BOX3D(1406048.71979489 5001440.005556,1406659.71754211 5001898.68905)"::BOX3D, -1 )

the query generated by mapserver has many syntax errors. If I try to execute in postgres the following query:

SELECT type::text,name::text,asbinary(force_collection(force_2d(the_geom)),"NDR"),gid::text from (SELECT the_geom,gid,type,name from places WHERE site_id = 1 and layer = "lyr_53") as foo USING UNIQUE gid WHERE the_geom && setSRID("BOX3D(1406048.71979489 5001440.005556,1406659.71754211 5001898.68905)"::BOX3D, -1 )

I get:

ERROR:  syntax error at or near "USING" at character 188
LINE 1: ...es WHERE site_id = 1 and layer = "lyr_53") as foo USING UNIQ...

and if I drop the USING UNIQUE clause:
SELECT type::text,name::text,asbinary(force_collection(force_2d(the_geom)),"NDR"),gid::text from (SELECT the_geom,gid,type,name from places WHERE site_id = 1 and layer = "lyr_53") as foo WHERE the_geom && setSRID("BOX3D(1406048.71979489 5001440.005556,1406659.71754211 5001898.68905)"::BOX3D, -1 )

now I get:

ERROR:  column "lyr_53" does not exist

obviously, because " is used instead of '.

Why? what is changed in the mapserver code?
How can I write the new query for mapserver 4.8?

Thanks in advance.
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051109/8be651dd/attachment.html


More information about the mapserver-users mailing list