5 -- Check if it is already there
6 PERFORM * FROM config.marc21_physical_characteristic_value_map v
7 JOIN config.marc21_physical_characteristic_subfield_map s ON v.ptype_subfield = s.id
8 WHERE s.ptype_key = 'v' AND s.subfield = 'e' AND s.start_pos = '4' AND s.length = '1'
16 -- Otherwise, insert it
17 INSERT INTO config.marc21_physical_characteristic_value_map (value,ptype_subfield,label)
18 SELECT 's',id,'Blu-ray'
19 FROM config.marc21_physical_characteristic_subfield_map
20 WHERE ptype_key = 'v' AND subfield = 'e' AND start_pos = '4' AND length = '1';
22 -- And reingest the blue-ray items so that things see the new value
23 SELECT INTO same_marc enabled FROM config.internal_flag WHERE name = 'ingest.reingest.force_on_same_marc';
24 UPDATE config.internal_flag SET enabled = true WHERE name = 'ingest.reingest.force_on_same_marc';
25 UPDATE biblio.record_entry SET marc=marc WHERE id IN (SELECT record
27 metabib.full_rec a JOIN metabib.full_rec b USING (record)
29 a.tag = 'LDR' AND a.value LIKE '______g%'
30 AND b.tag = '007' AND b.value LIKE 'v___s%');
31 UPDATE config.internal_flag SET enabled = same_marc WHERE name = 'ingest.reingest.force_on_same_marc';