<div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);">Hi there!</div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><br></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);">I've got a lot of fields stored as <span style="background-color:rgb(255, 255, 255);display:inline !important">character/text </span>but their contents are integers/numbers.</div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><br></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);">Ex: In my DB (postgresql), I have tableA with fieldA. FieldA is declared as a <span>character(2) but the content of rows are numbers... i.e. 71</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>The issue here is when I filter my data (QGIS or my web app) :</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><br></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>...?</span><div><span>SERVICE=WFS&</span></div><div><span>REQUEST=GetFeature&</span></div><div><span>VERSION=2.0.0&</span></div><div><span>TYPENAMES=ms:tableA&</span></div><div><span>STARTINDEX=0&COUNT=1000&</span></div><div><span>SRSNAME=urn:ogc:def:crs:EPSG::4326&</span></div><div><span>FILTER=</span></div><div><span><fes:Filter xmlns:fes="<a target="_blank" rel="noreferrer nofollow noopener" href="http://www.opengis.net/fes/2.0">http://www.opengis.net/fes/2.0</a>" xmlns:gml="<a target="_blank" rel="noreferrer nofollow noopener" href="http://www.opengis.net/gml/3.2">http://www.opengis.net/gml/3.2</a>"></span></div><div><span> <fes:And></span></div><div><span>  <fes:BBOX></span></div><div><span>   <fes:ValueReference>geometry</fes:ValueReference></span></div><div><span>   <gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"></span></div><div><span>    <gml:lowerCorner>40.77839999999999776 -87.96420000000000528</gml:lowerCorner></span></div><div><span>    <gml:upperCorner>51.88969999999999771 -68.37210000000000321</gml:upperCorner></span></div><div><span>   </gml:Envelope></span></div><div><span>  </fes:BBOX></span></div><div><span>  <fes:PropertyIsEqualTo xmlns:fes="<a target="_blank" rel="noreferrer nofollow noopener" href="http://www.opengis.net/fes/2.0">http://www.opengis.net/fes/2.0</a>"></span></div><div><span>   <fes:ValueReference>FieldA</fes:ValueReference></span></div><div><span>   <fes:Literal xmlns:fes="<a target="_blank" rel="noreferrer nofollow noopener" href="http://www.opengis.net/fes/2.0">http://www.opengis.net/fes/2.0</a>">71</fes:Literal></span></div><div><span>  </fes:PropertyIsEqualTo></span></div><div><span> </fes:And></span></div><div><span></fes:Filter></span></div><span></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>Mapserver return this error </span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><span style="font-family:monospace;font-size:13px"><ows:ExceptionText></span><span style="color:rgb(0, 0, 0);font-family:monospace;font-size:13px">msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs</span><span style="font-family:monospace;font-size:13px"></ows:ExceptionText></span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><span style="font-family:monospace;font-size:13px"> </span></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);">To fix this issue, I know that I must declare gml_<span style="background-color:rgb(255, 255, 255);display:inline !important">fieldA</span>_type<span> "Character".</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>Here the question: There is a method to automatically declare the type of all of thems?</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>The real issue about this question is that I have to handle near a thousand of layers, each of them containning a lot of fields! It's a scale issue!</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>Thanks</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span>Pierre</span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><span><br></span></div><div style="font-family: arial; font-size: 14px; color: rgb(34, 34, 34);"><br></div>