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

Paul Ramsey pramsey at refractions.net
Fri Mar 17 14:21:53 PST 2006


Open your dbf file in hexedit. I guarantee you, you will find  
"Lighted" and "Not lighted" in there.  shp2pgsql is not making this  
stuff, unless Sandro snuck an AI routine into the code while I was  
not looking :)

P

On Mar 17, 2006, at 1:47 AM, Christian Michels wrote:

> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list