[postgis-users] Problem with date fields in shp2pgsql

Bruce Rindahl rindahl at lrcwe.com
Fri Sep 8 15:20:26 PDT 2006


I am converting a shapefile to PostGIS where one of the fields is a date
field.  If there is data in the field everything works fine.  However if the
field is null, shp2pgsql parses the insert statement as:

INSERT INTO "test" (...,"saledate",...) VALUES (...,'',...);

pgsql will then throw an error saying:

ERROR:  invalid input syntax for type date: ""

If I change the ...,'',... to ...,NULL,... then the query runs.

Should shp2pgsql check for this?

Bruce Rindahl





More information about the postgis-users mailing list