<html><head></head><body><div class="gmail_quote">Il 11 ottobre 2016 10:45:18 CEST, Sandro Santilli <strk@kbt.io> ha scritto:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Chasing a regression bug upon importing shapefile to postgresql [1]<br />I've stumbled upon an unclear semantic of the "length" member of<br />QgsField class [2].<br /><br />The Ogr provider, upon loading shapefiles, uses the DBF field width<br />_minus_one_, for reasons that are unknown to me. Upon writing a layer<br />to PostgreSQL, the missing _one_ results in values being too large<br />for the field size.<br /><br />So the solution to this bug seems to be a clear definition of what<br />QgsField::length is supposed to be, beacuse either Ogr provider is<br />doing a mistake in reducing that field by 1 or PostgreSQL provider<br />is doing a mistake in NOT augmenting that field by 1.<br /><br />Does anyone have an idea about how should QgsField::length be<br />interpreted ?<br /><br /><br />[1] <a href="http://hub.qgis.org/issues/15188">http://hub.qgis.org/issues/15188</a><br />[2] <a
href="https://qgis.org/api/classQgsField.html#a8490cd90a5089a7f04bb97c725e54be9">https://qgis.org/api/classQgsField.html#a8490cd90a5089a7f04bb97c725e54be9</a><br /><br />--strk; <br /><br />  ()   Free GIS & Flash consultant/developer<br />  /\   <a href="https://strk.kbt.io/services.html">https://strk.kbt.io/services.html</a><br /><hr /><br />Qgis-developer mailing list<br />Qgis-developer@lists.osgeo.org<br />List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre></blockquote></div><br clear="all">Isn't it related to the comma being counted in real fields?<br>
All the best.<br>
-- <br>
Sent from mobile. Sorry for being short</body></html>