Found four more places that this needed to be changed.
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
<class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
<oils_persist:source_definition>
SELECT usr,
- ARRAY_TO_STRING(ARRAY_ACCUM(
+ STRING_AGG(
CASE
WHEN (
((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day' AND due_date > 'now'))
) THEN id
ELSE 0
END
- ),',') AS out,
+ ,',') AS out,
- ARRAY_TO_STRING(ARRAY_ACCUM(
+ STRING_AGG(
CASE
WHEN (
((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day' AND due_date < 'now'))
) THEN id
ELSE 0
END
- ),',') AS overdue,
+ ,',') AS overdue,
- ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id ELSE 0 END),',') AS lost,
- ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN id ELSE 0 END),',') AS claims_returned,
- ARRAY_TO_STRING(ARRAY_ACCUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id ELSE 0 END),',') AS long_overdue
+ STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id ELSE 0 END,',') AS lost,
+ STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN id ELSE 0 END,',') AS claims_returned,
+ STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id ELSE 0 END,',') AS long_overdue
FROM action.circulation
WHERE checkin_time IS NULL
GROUP BY 1
BEGIN;
-DROP AGGREGATE IF EXISTS array_accum(anyelement) CASCADE;
+DROP AGGREGATE IF EXISTS array_agg(anyelement) CASCADE;
DROP AGGREGATE IF EXISTS public.first(anyelement) CASCADE;
DROP AGGREGATE IF EXISTS public.last(anyelement) CASCADE;
DROP AGGREGATE IF EXISTS public.agg_text(text) CASCADE;
-CREATE AGGREGATE array_accum (
+CREATE AGGREGATE array_agg (
sfunc = array_append,
basetype = anyelement,
stype = anyarray,
$_$ LANGUAGE SQL STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION public.extract_marc_field ( TEXT, BIGINT, TEXT, TEXT ) RETURNS TEXT AS $$
- SELECT regexp_replace(array_to_string( array_accum( output ),' ' ),$4,'','g') FROM oils_xpath_table('id', 'marc', $1, $3, 'id='||$2)x(id INT, output TEXT);
+ SELECT regexp_replace(string_agg(output,' '),$4,'','g') FROM oils_xpath_table('id', 'marc', $1, $3, 'id='||$2)x(id INT, output TEXT);
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION oils_xml_uncache (xml TEXT) RETURNS BOOL AS $func$
END IF;
IF param_pref_ou IS NOT NULL THEN
- SELECT array_accum(distinct id) INTO tmp_int_list FROM actor.org_unit_ancestors(param_pref_ou);
+ SELECT array_agg(distinct id) INTO tmp_int_list FROM actor.org_unit_ancestors(param_pref_ou);
luri_org_list := luri_org_list || tmp_int_list;
END IF;