Replace ARRAY_ACCUM() custom function with ARRAY_AGG()
authorDan Scott <dscott@laurentian.ca>
Wed, 12 Oct 2011 03:53:33 +0000 (23:53 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 11 Nov 2011 20:37:04 +0000 (15:37 -0500)
commit2d046b9e26f6f035ce99c2bdac374ef9f41d5ddd
tree809627969a3afabc719fae30a6e55dc808d6b9b8
parent3762864f03c2ed7ccec910d25f7b6b950a1ccdca
Replace ARRAY_ACCUM() custom function with ARRAY_AGG()

Tested each replacement to ensure that the return of NULL instead of
'{}' empty array doesn't break anything - although some functions didn't
seem to work with either function (for example,
asset.merge_record_assets() doesn't seem to actually move an 856 from
the source to the target record).

Also replace ARRAY_TO_STRING(ARRAY_AGG()) with STRING_AGG() in a couple
of places; see
http://www.depesz.com/index.php/2010/02/17/waiting-for-9-0-string_agg/
for one reason why (likely performance gain).

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/000.functions.general.sql
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/100.circ_matrix.sql
Open-ILS/src/sql/Pg/110.hold_matrix.sql
Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Open-ILS/src/sql/Pg/990.schema.unapi.sql
Open-ILS/src/sql/Pg/999.functions.global.sql
Open-ILS/src/sql/Pg/example.reporter-extension.sql
Open-ILS/src/sql/Pg/reporter-schema.sql