Error on Itemnquery with PostGIS-layer
HarryS
mapcollect at GMX.NET
Tue Aug 21 04:16:28 PDT 2007
this is the layer configuration:
LAYER
NAME "City-Database"
GROUP "Databases"
STATUS default
DATA "the_geom from name"
CONNECTION "user=postgres dbname=geonamesallppl host=localhost
port=5432"
CONNECTIONTYPE postgis
TYPE QUERY
CLASS
TEMPLATE "template-city.html"
NAME "City-Database"
END
METADATA
"queryable" "true"
"searchfield" "name"
"fields"
"name:Name,population:Pop,country:Country,province:Province,CODE:Code"
END
END
Mapserver can render maps using this layer and also searching via
KaMap-Frontend works on this layer, only itemnquery via cgi gives me the
above quoted error. I tried using different cases with column names (NAME,
Name, name) but always got same error: ...ERROR: Column »london« does not
exist...
This I don't understand because »london« is the querystring and not the
column-name.
Thanks,
Harry
Umberto Nicoletti wrote:
>
> Please post the layer configuration for postgis AND check the case of
> the column name.
> Postgres handles column names with case sensitivity if, at table
> creation, the column name was in quotes. In that case you have the
> specify the column name with exactly the same case and in quotes; this
> is most likely the reason.
>
> HTH,
> Umberto
>
> On 8/21/07, HarryS <mapcollect at gmx.net> wrote:
>> doing this query:
>>
>> http://myServer.com/cgi-bin/mapserv?&map=/home/harry/Mapfiles/MyMap.map&mode=itemnquery&qlayer=City-Database&qitem=NAME&qstring='London'
>>
>> produces this Error:
>>
>> prepare_database(): Query error. Error executing POSTGIS DECLARE (the
>> actual
>> query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
>> NAME::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text
>> from name WHERE (London) and (the_geom && setSRID( 'BOX3D(-180 -90,180
>> 90)'::BOX3D,find_srid('','name','the_geom') ))'
>>
>> Postgresql reports the error as 'FEHLER: Spalte »london« existiert nicht
>> '
>> (Translation: ERROR: Column »london« does not exist)
>>
>> More Help:
>>
>> Error with POSTGIS data variable. You specified '<check your .map file>'.
>> Standard ways of specifiying are :
>> (1) 'geometry_column from geometry_table'
>> (2) 'geometry_column from (<sub query>) as foo using unique <column name>
>> using SRID=<srid#>'
>>
>> Make sure you put in the 'using unique <column name>' and 'using SRID=#'
>> clauses in.
>>
>> For more help, please see http://postgis.refractions.net/documentation/
>>
>> Mappostgis.c - version of Jan 23/2004.
>>
>>
>> If I do the same query on the same layer but using a shapefile instead of
>> PostGIS for identical data the query works fine without any errors. Can
>> someone point me to my mistake, please ?
>>
>> Harry Schmidt
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Error-on-Itemnquery-with-PostGIS-layer-tf4303941.html#a12250916
>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>>
>
>
--
View this message in context: http://www.nabble.com/Error-on-Itemnquery-with-PostGIS-layer-tf4303941.html#a12252666
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list