When I configure my layer as DATA "the_geom from <table_name> AS foo USING UNIQUE gid"<br>Mapserver returns the following error:<br><br><ServiceExceptionReport version="1.1.0"><br>−<br> <ServiceException>
<br><br>msDrawMap(): Image handling error. Failed to draw layer named 'percelen'.<br>prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from b_capa_percid AS foo WHERE the_geom && setSRID('BOX3D(
76945.5918856108 189996.502536997,91328.1081143621 201805.497460877)'::BOX3D, find_srid('','b_capa_percid AS foo','the_geom') )' <br><br>Postgresql reports the error as 'ERROR: find_srid() - couldnt find the corresponding SRID - is the geometry registered in the GEOMETRY_COLUMNS table? Is there an uppercase/lowercase missmatch?
<br>'<br><br>More Help:<br><br>Error with POSTGIS data variable. You specified 'check your .map file'.<br>Standard ways of specifiying are : <br>(1) 'geometry_column from geometry_table' <br>(2) 'geometry_column from (sub query) as foo using unique column name using SRID=srid#'
<br><br>Make sure you put in the 'using unique column name' and 'using SRID=#' clauses in.<br><br>For more help, please see <a href="http://postgis.refractions.net/documentation/">http://postgis.refractions.net/documentation/
</a> <br><br>Mappostgis.c - version of Jan 23/2004.<br><br></ServiceException><br></ServiceExceptionReport><br><br><br>However when I add the SRID=31300, Mapserver throws this:<br><br><br>−<br> <ServiceExceptionReport version="
1.1.0"><br>−<br> <ServiceException><br><br>msDrawMap(): Image handling error. Failed to draw layer named 'percelen'.<br>msPOSTGISLayerWhichShapes(): Query error. Error executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from b_capa_percid AS foo WHERE the_geom && setSRID('BOX3D(
76945.5918856108 189996.502536997,91328.1081143621 201805.497460877)'::BOX3D, 31300 )<br>-ERROR: Operation on two geometries with different SRIDs<br><br><br></ServiceException><br></ServiceExceptionReport>
<br><br><br>How can I use the gid as unique column ?<br><br>Thanks <br>Steven<br>