LP#1243023: Clean up string handling variable types
authorMike Rylander <mrylander@gmail.com>
Mon, 3 Mar 2014 19:26:46 +0000 (14:26 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 19 Mar 2014 01:25:34 +0000 (21:25 -0400)
It was already TEXT, no need to flip back and forth between that
and XML.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/011.schema.authority.sql

index 7033773..d3527f2 100644 (file)
@@ -350,10 +350,10 @@ BEGIN
         nfi_used := acsaf.nfi;
         joiner_text := COALESCE(acsaf.joiner, ' ');
 
-        FOR tmp_xml IN SELECT UNNEST(XPATH('//*[@tag="'||tag_used||'"]', marcxml::XML)) LOOP
+        FOR tmp_xml IN SELECT UNNEST(XPATH('//*[@tag="'||tag_used||'"]', marcxml::XML)::TEXT[]) LOOP
 
             heading_text := COALESCE(
-                oils_xpath_string('./*[contains("'||acsaf.display_sf_list||'",@code)]', tmp_xml::TEXT, joiner_text),
+                oils_xpath_string('./*[contains("'||acsaf.display_sf_list||'",@code)]', tmp_xml, joiner_text),
                 ''
             );