Closed pnorman closed 8 years ago
Loading up the shapefile, I see that the in-DB cartodb_ids differ from those in the shapefile.
Looking at the OGR PostgreSQL driver documentation, I think I see the problem.
FID: (From GDAL 1.9.0) Name of the FID column to create. Defaults to 'ogc_fid'.
This option is causing a cartodb_id column to be created and automatically populated as a postgres serial. This column conflicts with a cartodb_id column which it tries to populate from the shapefile.
I'm actually surprised this results in a populated table rather than an error when inserting.
If I omit this option, it lets these tables import, but will break those without cartodb_id already in the shapefile, and results in a ogr_fid column as a primary key.
I tried using -preserve_fid
but that didn't change the results.
fixed in develop
The
section of code prints the following errors
These seem to be the shapefiles which already have a cartodb_id.