I'm trying to insert rows from one
cartodb table into another using the method outlined here:
INSERT INTO gfw_mining_test (the_geom, the_geom_webmercator, objectid, country,type, gfwid, st_area_sh, st_length_) SELECT the_geom, the_geom_webmercator, objectid, country, type, gfwid, st_area_sh, st_length_ FROM gab_mining_staging WHERE cartodb_id >= 0 and cartodb_id < 500000
I'm getting an error that there's duplicate data in the table:
duplicate key value violates unique constraint "gfw_mining_test_pkey"
I've queried the table to get the primary key and it seems to be cartodb_id. Both my source and my target datasets have this column. I'm trying to append data from my source without including the cartodb_id column in the hopes that the cartodb_id values for these new rows will be automatically generated in the target table.
Does this make sense? Why am I getting this error? Is there another key constraint that I'm running up against?