Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table rogan.alice as
- select id from biblio.record_entry where source = 102;
- select count(id) from rogan.alice;
- alter table rogan.alice add column ingested boolean default false;
- -- now the batches
- UPDATE config.internal_flag SET enabled = TRUE WHERE name = 'ingest.reingest.force_on_same_marc';
- UPDATE biblio.record_entry SET id = id WHERE id in (select id from rogan.alice where ingested = FALSE order by id limit 500);
- update rogan.alice set ingested = TRUE where id in (select id from rogan.alice where ingested = false order by id limit 500);
- UPDATE config.internal_flag SET enabled = FALSE WHERE name = 'ingest.reingest.force_on_same_marc';
- -- stuff to reingest records from wiki
- -- update flag to force reingesting the record even if the MARC hasn't changed
- UPDATE config.internal_flag SET enabled = TRUE WHERE name = 'ingest.reingest.force_on_same_marc';
- UPDATE biblio.record_entry SET id = id WHERE id = 123;
- UPDATE config.internal_flag SET enabled = FALSE WHERE name = 'ingest.reingest.force_on_same_marc';
- -- The same spell can be used to reingest an authority record:
- UPDATE config.internal_flag SET enabled = TRUE WHERE name = 'ingest.reingest.force_on_same_marc';
- UPDATE authority.record_entry SET id = id WHERE id = 123;
- UPDATE config.internal_flag SET enabled = FALSE WHERE name = 'ingest.reingest.force_on_same_marc';
- -- here are several other flags that can be tweaked to selectively control which index tables get updated. These include:
- ingest.metarecord_mapping.skip_on_update (enabling this can significantly speed up the reingest of a large number of records)
- ingest.disable_located_uri
- ingest.disable_metabib_full_rec
- ingest.disable_metabib_rec_descriptor
- ingest.disable_metabib_field_entry
- -- Some flags apply when inserting new bibs:
- ingest.metarecord_mapping.skip_on_insert (enabling this can significantly speed up importing a large number of bibs; use the spell for creating metarecords after loading the bibs)
- ingest.assume_inserts_only
- Other flags apply when dealing with authority records or changes to authorities:
- ingest.disable_authority_linking
- ingest.disable_authority_auto_update
- -- Dyrcona's
- -- 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$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement