<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1522" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have just installed the new 4.8beta code and the
postgis query give me a syntax problem.<BR>My query is the
following:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>and follow the mapserver error:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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 )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>the query generated by mapserver has many syntax
errors. If I try to execute in postgres the following query:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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 )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I get:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>ERROR: syntax error at or near "USING" at
character 188<BR>LINE 1: ...es WHERE site_id = 1 and layer = "lyr_53") as foo
USING UNIQ...<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>and if I drop the USING UNIQUE clause:<BR>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 )</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>now I get:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>ERROR: column "lyr_53" does not
exist</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>obviously, because " is used instead of
'.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Why? what is changed in the mapserver code?<BR>How
can I write the new query for mapserver 4.8?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2>Stefano</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>