[gdal-dev] Bad Date Handling

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Apr 6 05:52:00 PDT 2016


On 2016-04-05 3:56 PM, Paul Ramsey wrote:
> Hey all,
>
> We've had a client working with dodgy data who would like an option to
> avoid incompatible date mangling when reading bad data. Basically, OGR
> will consume some funky dates from CSV and Excel, like 0000/00/00, but
> it will NULL out others, like 1971/34/34. The net result is that, when
> the data are written out to PgSQL, is some null values, and other
> values that get converted to things PgSQL cannot consume (0000/00/00
> becomes 2000/00/00 and PgSQL then errors out on that).
> They'd like to just coerce *all* invalid dates to NULL,
>
> I've done a small patch that does that, in the presence of a config
> flag, any thoughts on if it's acceptable?
>
> https://github.com/pramsey/gdal/pull/1
>
> ATB,
>

This makes a lot of sense to me.  I support this change (as a DB 
manager, and often stuck on date import issues).  I think this change is 
a good fix for now.

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/







More information about the gdal-dev mailing list