-- 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
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;