4 DROP FUNCTION authority.propagate_changes (BIGINT, BIGINT);
6 CREATE OR REPLACE FUNCTION authority.propagate_changes
7 (aid BIGINT, bid BIGINT) RETURNS BIGINT AS $func$
9 bib_rec biblio.record_entry%ROWTYPE;
12 SELECT INTO bib_rec * FROM biblio.record_entry WHERE id = bid;
14 bib_rec.marc := vandelay.merge_record_xml(
15 bib_rec.marc, authority.generate_overlay_template(aid));
17 PERFORM 1 FROM config.global_flag
18 WHERE name = 'ingest.disable_authority_auto_update_bib_meta'
22 -- update the bib record editor and edit_date
24 SELECT editor FROM authority.record_entry WHERE id = aid);
25 bib_rec.edit_date = NOW();
28 UPDATE biblio.record_entry SET
30 editor = bib_rec.editor,
31 edit_date = bib_rec.edit_date
37 $func$ LANGUAGE PLPGSQL;
41 -- Disabled by default
42 INSERT INTO config.global_flag (name, enabled, label) VALUES (
43 'ingest.disable_authority_auto_update_bib_meta', FALSE,
45 'ingest.disable_authority_auto_update_bib_meta',
46 'Authority Automation: Disable automatic authority updates ' ||
47 'from modifying bib record editor and edit_date',