Avoid collisions of normalized values going into metabib.browse_entry
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 14 May 2012 16:46:44 +0000 (12:46 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 14 May 2012 19:21:18 +0000 (15:21 -0400)
commit27cfefce8b098f5acc210c73c7c992aba070998e
tree1420caea2b2fd43c6e908e614305f7f1efa39022
parent172ebd640cbed0a6fbebcfdb3e0ff494f4f35ee4
Avoid collisions of normalized values going into metabib.browse_entry

This fixes a bug that prevented successful reingestion of bib records
during the 2.1->2.2 upgrade in some cases.  Reported by George Duimovich.

Key part here:

> ERROR: duplicate key value violates unique constraint
> "browse_entry_value_key"
> DETAIL: Key (value)=(545575) already exists.
> CONTEXT: SQL statement "INSERT INTO metabib.browse_entry (value) VALUES
>                     (metabib.browse_normalize(ind_data.value,

George confirmed that the changes to the version upgrade script fixed
the problem for him.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0711.schema.reingest_avoid_collision_better.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql