[Gdal-dev] ogr2ogr shapefile to postgis error

Frank Warmerdam warmerdam at pobox.com
Wed Sep 29 23:56:35 EDT 2004


Michael Mallete wrote:
> hello again mr. warmerdam! 
> 
> yes now it works! i tried using ogr2ogr with "-nlt multipolygon"
> option. i guess that solves that. thank you so much for this. :)
> 
> although i do have another problem. there are some shapefiles that
> when i convert/insert, this error appears:
> 
> ERROR 1: INSERT command for new feature failed.
> ERROR: numeric field overflow
> 
> ERROR 1: Terminating translation prematurely after failed translation
> of layer <layer name here>
> 
> what does "numeric field overflow" mean? sorry for being a pest. my
> problems just keep on coming. anyway thank you so much again sir for
> your help.

Michael,

DBF files include information on the width and precision of numeric fields.
But they don't necesarily enforce them while PostgreSQL does.  I suspect
that some numeric values are being passed through that don't match with the
field definition used and this is causing PostgreSQL to choke.  It would be
helpful if you could provide a sample dataset with this problem for me to
investigate further.

I actually did some work recently on the PG driver in OGR to auto-trim long
strings when needed.  Perhaps something similar will be needed for numeric
fields.

In the meantime, you may find the -skipfailures switch to ogr2ogr lets you
proceed with loading most of your data.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list