-- we need to tell Evergreen that every record we have in the system is a Unicode record:
--- disable triggers on biblio.record_entry:
+-- disable triggers on biblio.record_entry and authority.record_entry:
+ALTER TABLE biblio.record_entry DISABLE TRIGGER ALL;
+ALTER TABLE authority.record_entry DISABLE TRIGGER ALL;
+BEGIN;
UPDATE biblio.record_entry
SET marc = regexp_replace(marc, E'(<leader>.{9}).', E'\\1a');
+UPDATE authority.record_entry
+ SET marc = regexp_replace(marc, E'(<leader>.{9}).', E'\\1a');
+COMMIT;
+
+-- re-enable triggers
+ALTER TABLE biblio.record_entry ENABLE TRIGGER ALL;
+ALTER TABLE authority.record_entry ENABLE TRIGGER ALL;
+-- except for one for each table that was disabled before we started
+ALTER TABLE biblio.record_entry DISABLE TRIGGER _replication_denyaccess;
+ALTER TABLE authority.record_entry DISABLE TRIGGER _replication_denyaccess;
-- These are restored by the post-upgrade PINES sql script.