Error importing Johan's shapefile
While importing Johan's shapefile of Optic Fibers, this error is displayed:
"Error: Unexpected import error: duplicate key value violates unique constraint "optical_fiber_pkey" DETAIL: Key (id)=(2) already exists."
#1 Updated by Philippe May over 1 year ago
Technical information below. @Giulio: it's fine to ignore
On my laptop, i noticed that the sequence (responsible for auto-increment of the primary key) was strange.
So, a fix would be (note that on my laptop, i deleted the records and imported, so this needs to be tested on server):
SELECT MAX(id)+1 FROM avsm_misc.optical_fiber; -- Return 319 ALTER SEQUENCE avsm_misc.optical_fiber_id_seq RESTART WITH 319; ALTER TABLE avsm_misc.optical_fiber ALTER id SET DEFAULT nextval('avsm_misc.optical_fiber_id_seq');
Fixed also some related issues (5e93e043).