Closed pramsey closed 6 years ago
A client is experiencing this same issue when using ogr2ogr to have a ETL workflow to append data to the same table when importing with ogr2ogr. Having a message error like
CARTO: RunSQL Response:{"error":["relation \"<relname>_cartodb_id_seq\" does not exist"]}
ERROR 1: Error returned by server : relation "<relname>_cartodb_id_seq" does not exist
Thank you guys for the fix and review.
Aside from the merge, there's also release and deploy for users to enjoy it. @oriolbx can you please reference the issue here and add as candidate to the RT?
We gave the affected user an alternative to install and build the version where there is the fix. The fix went into gdal 2.2, so they can work off a stable branch https://trac.osgeo.org/gdal/changeset/41287
and to download it. They need to check out svn checkout https://svn.osgeo.org/gdal/branches/2.2/ gdal-2.2-svn
and build the library
This doesn't really fix anything on our side, since the existing code already avoids sequence name collisions, but it addresses the issue in #318. This would just allow older versions of ogr2ogr to avoid the bug fixed in 7203 where ogr2ogr fixates on having a serial sequence named
<relname>_cartodb_id_seq
. What exposed the error wasogr2ogr
data upload (works)It happens because after the first
ogr2ogr
upload, the table is cartodb'fyed, and the sequence name changes when cartodbfy does the copy step, so it ends up with a unique sequence name that is not the<relname>_cartodb_id_seq
formogr2ogr
expects when running in-append
mode, which seems to be the default for a not-first upload.