(OJS 3.2.0-3) DB Error: duplicate key value violates unique constraint "publication_galleys_pkey"

Hi Tarcisio

No.
error log from postgresql 9.6 shows:

INSERT INTO publication_galleys (locale, label, publication_id, url_path, remote_url) VALUES ( $1, $2, $3, $4, $5)
DETAIL: parameters: $1 = ‘es_ES’, $2 = ‘PDF’, $3 = ‘247’, $4 = ‘’, $5 = ‘’
ERROR: duplicate key value violates unique constraint “publication_galleys_pkey”
DETAIL: Key (galley_id)=(22) already exists.

and doing:
SELECT max(galley_id) FROM publication_galleys;
returns:
max

190

so, I think this is needing an update on serial because:
SELECT * FROM publication_galleys_galley_id_seq ;
returns:
sequence_name | publication_galleys_galley_id_seq
last_value | 22
start_value | 1
increment_by | 1
max_value | 9223372036854775807
min_value | 1
cache_value | 1
log_cnt | 32
is_cycled | f
is_called | t

If somebody tells me it’s okey to do:
ALTER SEQUENCE publication_galleys_galley_id_seq RESTART WITH 190;
I go with it.

Thanks for asking. Any help is appreciated. Regards

1 Like