Skip to content

Instantly share code, notes, and snippets.

@Dyrcona
Last active Mar 11, 2016
Embed
What would you like to do?
A simple, little SQL script to reingest bibs in Evergreen.
-- A simple SQL to "reingest" your bib records in Evergreen.
-- Feel free to use it however you like, though the easiest way is to
-- save it into a file and do psql -f filename.
DO $$
DECLARE
flag BOOLEAN;
BEGIN
SELECT enabled INTO flag
FROM config.internal_flag
WHERE name = 'ingest.reingest.force_on_same_marc';
IF flag IS FALSE THEN
UPDATE config.internal_flag
SET enabled = TRUE
WHERE name = 'ingest.reingest.force_on_same_marc';
END IF;
UPDATE biblio.record_entry
SET marc = marc
WHERE id > 0;
IF flag IS FALSE THEN
UPDATE config.internal_flag
SET enabled = flag
WHERE name = 'ingest.reingest.force_on_same_marc';
END IF;
END$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment