Project

General

Profile

Bug #10180

Error importing Johan's shapefile

Added by Giulio Di Anastasio over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
25/05/2020
Due date:
% Done:

0%

Close

Description

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

History

#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).

#2 Updated by Philippe May over 1 year ago

  • Status changed from New to Resolved

Shapefile import OK.

The new admin baskets might need other rounds of fine tuning, but we'll get there.

Also available in: Atom PDF