agg_text_sum(txt_new text, txt_before text)

8.27. agg_text_sum(txt_new text, txt_before text)

Function Properties

Language: PLPGSQL

Return Type: text

An accumulator function used by the slony string_agg function to aggregate rows into a string

DECLARE
  c_delim text;
BEGIN
    c_delim = ',';
	IF (txt_before IS NULL or txt_before='') THEN
	   RETURN txt_new;
	END IF;
	RETURN txt_before || c_delim || txt_new;
END;