Hello list,<br><br>Filter encoding seems to suffer from a type problem with Postgis. I want to confirm the problem and check I don&#39;t miss something.<br><br>So my use case.<br>I have created a Postgis table.<br>The structure of the table starts with<br>


<br>
CREATE TABLE departement<br>
(<br>
  gid serial NOT NULL,<br>
  id_geofla numeric(10,0),<br>
  code_dept character varying(2),<br>
  nom_dept character varying(30),<br>
  the_geom geometry,<br>....<br>
<br>

I use this postgis layer in a WFS webservices<br>A query like <a href="http://localhost/cgi-bin/mapserv?map=/home/test/SIG/france/mapfiles/mapfile_carte.map&amp;REQUEST=GetFeature&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=departements&amp;OUTPUT=gml">http://localhost/cgi-bin/mapserv?map=/home/test/SIG/france/mapfiles/mapfile_carte.map&amp;REQUEST=GetFeature&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=departements&amp;OUTPUT=gml</a> works.<br>

<br>When I use a filter like<br><a href="http://localhost/cgi-bin/mapserv?map=/home/test/SIG/france/mapfiles/mapfile_carte.map&amp;REQUEST=GetFeature&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=departements&amp;OUTPUT=gml&amp;Filter=">http://localhost/cgi-bin/mapserv?map=/home/test/SIG/france/mapfiles/mapfile_carte.map&amp;REQUEST=GetFeature&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=departements&amp;OUTPUT=gml&amp;Filter=</a>&lt;Filter&gt;&lt;PropertyIsEqualTo&gt;&lt;PropertyName&gt;code_dept&lt;/PropertyName&gt;&lt;Literal&gt;01&lt;/Literal&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;<br>

there is an error with the message below.<br>&lt;ServiceExceptionReport version=&quot;1.2.0&quot; xmlns=&quot;<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a>&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot; xsi:schemaLocation=&quot;<a href="http://www.opengis.net/ogc">http://www.opengis.net/ogc</a> <a href="http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd</a>&quot;&gt;<br>

&lt;ServiceException code=&quot;NoApplicableCode&quot; locator=&quot;mapserv&quot;&gt;<br>msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msPostGISLayerWhichShapes(): Query error. Error (ERREUR: l&#39;opérateur n&#39;existe pas : character varying = integer LINE 1: ...d_srid(&#39;&#39;,&#39;departement&#39;,&#39;the_geom&#39;)) and ( (code_dept= 01) ) ^ HINT: Aucun opérateur ne correspond au nom donné et aux types d&#39;arguments. Vous devez ajouter des conversions explicites de type. ) executing query: select &quot;gid&quot;,&quot;id_geofla&quot;,&quot;code_dept&quot;,&quot;nom_dept&quot;,encode(AsBinary(force_collection(force_2d(&quot;the_geom&quot;)),&#39;NDR&#39;),&#39;hex&#39;) as geom,&quot;oid&quot; from departement where the_geom &amp;&amp; GeomFromText(&#39;POLYGON((-25000000 -25000000,-25000000 25000000,25000000 25000000,25000000 -25000000,-25000000 -25000000))&#39;,find_srid(&#39;&#39;,&#39;departement&#39;,&#39;the_geom&#39;)) and ( (code_dept= 01) ) <br>

&lt;/ServiceException&gt;<br>&lt;/ServiceExceptionReport&gt;<br><br>It seems to come from cast : mapserver receives the parameter from the url but doesn&#39;t check type and considers the retrieved value as an integer (because there is no quotes)<br>

This problem occurs with Postgis but not with a shapefile (the same url works...). I&#39;ve done some test with oid = true but nothing changes too<br><br>Regards<br><br>ThomasG<br>