CREATE TABLE reindex.failed (id int, reason TEXT);
-- INSERT ALL THE BIBS
---INSERT INTO reindex.to_do SELECT id from biblio.record_entry where not deleted;
+INSERT INTO reindex.to_do SELECT id from biblio.record_entry where not deleted;
CREATE OR REPLACE FUNCTION reindex.cleanup_marc(TEXT) RETURNS TEXT as $func$
use MARC::Record;
use MARC::File::XML (BinaryEncoding => 'UTF-8');
use MARC::Charset;
use Unicode::Normalize;
+use Encode qw(decode_utf8);
use strict;
MARC::Charset->assume_unicode(1);