Bug report #3335

SPIT converts null dates to invalid values

Added by Aren Cambre almost 11 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Low
Assignee:Tim Sutton
Category:C++ Plugins
Affected QGIS version: Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data: Copied to github as #:13395

Description

If I have a shapefile with a DBF that has null values in the date column, SPIT translates these null dates to an invalid 0000/00/00 value. For example, this error:

Problem inserting features from file:
C:/[redacted]/TxDOT_Roadways.shp
The database gave an error while executing this SQL:
INSERT INTO "public"."TxDOT_Roadways"("OBJECTID","STRATMAP_I","RTE_NM",... (rest of SQL trimmed)
The error was:
ERROR:  date/time field value out of range: "0000/00/00" 
LINE 1: ...0','058AA0353','AA','353',NULL,'353','2010/12/01','0000/00/0...

If I use shp2pgsql.exe instead, the date gets translated to NULL in the INSERT INTO statements.

If you want to reproduce, download TxDOT Roadways 2010 at http://www.tnris.state.tx.us/datadownload/download.jsp and import TxDOT_Roadways.shp.

History

#1 Updated by Paolo Cavallini almost 10 years ago

  • Pull Request or Patch supplied set to No
  • Resolution set to wontfix
  • Status changed from Open to Closed

IMHO SPIT will not be maintained, as DB Manager will enter into Master. No work should go into fixing this.

Also available in: Atom PDF