Opened 6 years ago

Closed 6 years ago

#4265 closed defect (fixed)

ogr2ogr PostGIS null date fields

Reported by: andycolson Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

This download is 16Meg, and expands to 157Meg.

http://squeakycode.net/parcelAnnoV2.zip

The recorded column has rows that are null.

Using COPY, I get date errors:

PG_USE_COPY=YES ogr2ogr -f PostgreSQL -lco FID=gid -lco SPATIAL_INDEX=OFF -lco GEOMETRY_NAME=the_geom -lco SCHEMA=junk -lco SRID=3857 -t_srs EPSG:3857 -nlt MULTIPOLYGON 'PG:dbname=gis' ParcelAnnoV2.shp

... ERROR 1: COPY statement failed. ERROR: date/time field value out of range: "0000/00/00" CONTEXT: COPY parcelannov2, line 18, column recorded: "0000/00/00"

This works fine, but slow:

PG_USE_COPY=NO ogr2ogr -f PostgreSQL -lco FID=gid -lco SPATIAL_INDEX=OFF -lco GEOMETRY_NAME=the_geom -lco SCHEMA=junk -lco SRID=3857 -t_srs EPSG:3857 -nlt MULTIPOLYGON 'PG:dbname=gis' ParcelAnnoV2.shp

I am using: GDAL 1.9dev, released 2011/01/18

Change History (1)

comment:1 Changed 6 years ago by Even Rouault

Component: defaultOGR_SF
Milestone: 1.9.0
Resolution: fixed
Status: newclosed

r23127 /trunk/gdal/ogr/ogrsf_frmts/shape/shape2ogr.cpp: Shapefile driver: recognize blank values for Date fields as null values (#4265)

Note: See TracTickets for help on using tickets.