explicitly adding search path; altering the regexp_replace function to catch *all...
authorChris Sharp <csharp@georgialibraries.org>
Sat, 16 Feb 2013 14:41:00 +0000 (09:41 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 16 Feb 2013 14:41:00 +0000 (09:41 -0500)
Open-ILS/src/sql/Pg/version-upgrade/pines-pre-2.1-2.2-upgrade.sql

index 472cb4b..5cb4148 100644 (file)
@@ -3,6 +3,10 @@
 -- remove replication schema
 DROP SCHEMA _replication CASCADE;
 
+
+-- this should already be true, but explicitly setting the search path to include the evergreen schema:
+SELECT evergreen.change_db_setting('search_path', ARRAY['evergreen','public','pg_catalog']);
+
 -- For preventing invalid marcxml - possible supplement or replacement for biblio.check_marcxml_well_formed?
 -- Should be useful for flagging bad MARCXML that has slipped in over time
 
@@ -43,7 +47,7 @@ CREATE INDEX aud_serial_unit_hist_editor_idx      ON auditor.serial_unit_history
 ALTER TABLE biblio.record_entry DISABLE TRIGGER ALL;
 
 UPDATE biblio.record_entry
-    SET marc = regexp_replace(marc, E'(<leader>.{9}).', E'\\1a');
+    SET marc = regexp_replace(marc, E'(<leader[^>]*>.{9}).', E'\\1a');
 
 ALTER TABLE biblio.record_entry ENABLE TRIGGER ALL;