Last active
February 22, 2017 17:07
-
-
Save matheusoliveira/dc02ee13e10c7251c5cff38f4427d138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION wm_concat_finalfn(anyarray) | |
RETURNS text | |
LANGUAGE SQL | |
IMMUTABLE AS $$ | |
SELECT array_to_string($1, ','); | |
$$; | |
DROP AGGREGATE IF EXISTS wm_concat(anyelement); | |
CREATE AGGREGATE wm_concat(anyelement) ( | |
SFUNC = array_append, | |
STYPE = anyarray, | |
FINALFUNC = wm_concat_finalfn | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment