Now that asset.merge_record_assets() is working, cut over to
STRING_AGG() so it can iterate over those unnecessary nodes faster :)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
' tag="856"' ||
' ind1="' || FIRST(ind1) || '"' ||
' ind2="' || FIRST(ind2) || '">' ||
- array_to_string(
- ARRAY_AGG(
- '<subfield code="' || subfield || '">' ||
+ STRING_AGG(
+ '<subfield code="' || subfield || '">' ||
+ regexp_replace(
regexp_replace(
- regexp_replace(
- regexp_replace(data,'&','&','g'),
- '>', '>', 'g'
- ),
- '<', '<', 'g'
- ) || '</subfield>'
- ), ''
+ regexp_replace(data,'&','&','g'),
+ '>', '>', 'g'
+ ),
+ '<', '<', 'g'
+ ) || '</subfield>', ''
) || '</datafield>' INTO uri_datafield
FROM oils_xpath_table(
'id',