Chasing a regression bug upon importing shapefile to postgresql 
I've stumbled upon an unclear semantic of the "length" member of
QgsField class .
The Ogr provider, upon loading shapefiles, uses the DBF field width
_minus_one_, for reasons that are unknown to me. Upon writing a layer
to PostgreSQL, the missing _one_ results in values being too large
for the field size.
So the solution to this bug seems to be a clear definition of what
QgsField::length is supposed to be, beacuse either Ogr provider is
doing a mistake in reducing that field by 1 or PostgreSQL provider
is doing a mistake in NOT augmenting that field by 1.
Does anyone have an idea about how should QgsField::length be
() Free GIS & Flash consultant/developer
Qgis-developer mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer