[Mapserver-users] querybyattributes for postgis

AARON KONING aaronkoning at shaw.ca
Wed Apr 28 12:31:26 EDT 2004


Hello list,

I am just wondering if anyone else has run into the
problem of querybyattributes not working the same
for shapefiles and postgis data sources. Is this normal or unexpected (see below)?

example using shapefiles:
   querybyattributes('FCODE','GGD3BC3',MS_SINGLE);
example 2 using shapefiles:
   querybyattributes('FCODE',"'[FCODE]' = 'GGD3BC3'",MS_SINGLE);
example using a postgis data source:
   querybyattributes('FCODE',"fcode = 'GGD3BC3'",MS_SINGLE);

Notice the second argument is different. 
If I use the second shapefile method with a postgis
data source I get a notice:
  msQueryByAttributes(): No matching record(s) found
If I use the first shapefile method with a postgis data source, I end up with a segmentation fault and this error:

Warning:  [MapServer Error]: prep_DB(): Error executing POSTGIS  DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT FCODE::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text from public.ipln_bc AS foo WHERE (GGD3BC3) and (the_geom && setSRID( 'BOX3D(260000 304689.378757515,1875000 1783310.62124249)'::BOX3D,42102) )'

Which translates into: the GGD3BC3 part of "...WHERE
(GGD3BC3) and..." does not evaluate to a boolean.

Thanks,
Aaron





More information about the mapserver-users mailing list