Bug report #3335

SPIT converts null dates to invalid values

Added by Aren Cambre almost 12 years ago. Updated about 11 years ago.

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


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:
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.


#1 Updated by Paolo Cavallini about 11 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