From: Chris Sharp Date: Mon, 10 Sep 2018 20:37:11 +0000 (-0400) Subject: Add fix for PG segfaults during reingest. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ec21fd927c637c68e9003fd9e4aa032109e6efc6;p=evergreen%2Fpines.git Add fix for PG segfaults during reingest. Also add inline docs. --- diff --git a/Open-ILS/src/sql/Pg/version-upgrade/pines-pre-3.2-upgrade.sql b/Open-ILS/src/sql/Pg/version-upgrade/pines-pre-3.2-upgrade.sql index 465d1fe3b0..46e080ea49 100644 --- a/Open-ILS/src/sql/Pg/version-upgrade/pines-pre-3.2-upgrade.sql +++ b/Open-ILS/src/sql/Pg/version-upgrade/pines-pre-3.2-upgrade.sql @@ -1,5 +1,7 @@ begin; + +-- drop/replace function that will not work with the upgrade scripts drop function if exists public.oils_json_to_text(text); CREATE OR REPLACE FUNCTION evergreen.oils_json_to_text( TEXT ) RETURNS TEXT AS $f$ @@ -11,8 +13,19 @@ CREATE OR REPLACE FUNCTION evergreen.oils_json_to_text( TEXT ) RETURNS TEXT AS $ return $txt $f$ LANGUAGE PLPERLU; + +-- drop view that depends on a table that gets upgraded drop view reporter.copy_statistics_view; +-- fix a mismatch between sequence and ID select setval('action_trigger.event_definition_id_seq', ((select max(id) from action_trigger.event_definition) + 1)); +-- fix a problem that would otherwise cause segfaults during the reingest/later +-- update mods33 data entered by 1100 with a format of 'mods32' +-- harmless if you have not run 1100 yet +UPDATE config.metabib_field SET format = 'mods33' WHERE format = 'mods32' and id in (38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50); + +-- change the default format to 'mods33' +ALTER TABLE config.metabib_field ALTER COLUMN format SET DEFAULT 'mods33'::text; + commit;