[Gdal-dev] OGR can't handle Null values in a Date field

Mateusz Loskot mateusz at loskot.net
Mon Jun 19 23:01:43 EDT 2006


Frank Warmerdam wrote:
> Aaron Koning wrote:
>> I have just started using a newer version of OGR that includes Date
>> support. (Context: I am importing shapefiles into PostgreSQL using
>> OGR/PHP). Unfortunately, when I there is a Null value in a Date field
>> of the input shapefile OGR bails (after successfully inserting
>> non-null values). From what I can see, it attempts to do an insert
>> with a '00/00/00 00:00:00' value and PostgreSQL states I may need
>> another Date type for this value.
>>
>> Is there anyway of getting OGR to output Null values into a Date field
>> when there is a Null value present in the input Date field?
>> Alternatively, the previous versions of OGR simply converted Date
>> fields to strings. Is there a way to revive this action (when I set
>> the output field type to string instead of bool, it doesn't work).
> 
> Aaron,
> 
> Date fields are intended to support nulls.  Could you provide me
> with a shapefile with some null dates I could test with?  I think there
> is just a bug at some point in the code with null propogation in date
> fields.

Frank,

As we talked on the #gdal-dev, I'm taking this bug.

Aaron,

As Frank is asking above, please provide me with some sample of your
shapefiles. Thanks!

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list