[postgis-users] shp2pgsql changes data values during sql dump

Christian Michels christian.michels at eifelgeist.com
Fri Mar 17 01:47:15 PST 2006

Dear List,

I use postgres version 8.1.3 on Windows 2003 Server and PostGis Version "POSTGIS="1.0.4" GEOS="2.1.4" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS DBPROC="0.3.0" RELPROC="0.3.0".

I face some really strange problems during a shp2pgsql dump of a shapefile into a sql file.
I execute the following ...
shp2pgsql -s 4326 -D SHPFILE SHPFILETABLE learning > "D:\SHPFILEDUMP.sql"

The dump runs without any error message. But when I look at the resulting sql file I recognized some strange values which are not in the shapefile. There is one field defined as - "light" int8 - this is correct and the same definition like in the SHP file. The field values in the shapfile are 0 and I would expect a 0 in the sql dump file BUT I get the values "Not lighted" or "Lighted". I have no idea where these strings come from. Trying to load the sql file to postgres results in the error that a string cannot be written into a int8 field which is clear so far ! But why does change the value from 0 to a string during the dump process ??

Any help is very much apprechiated !

Thanx - Chris

More information about the postgis-users mailing list