Re: Seamless replacement to MySQL's GROUP_CONCAT function... - Mailing list pgsql-general

From immersive.excel@gmail.com
Subject Re: Seamless replacement to MySQL's GROUP_CONCAT function...
Date
Msg-id 52003BC0.6070806@gmail.com
Whole thread Raw
In response to Re: Seamless replacement to MySQL's GROUP_CONCAT function...  ("immersive.excel@gmail.com" <immersive.excel@gmail.com>)
Responses Re: Seamless replacement to MySQL's GROUP_CONCAT function...  ("immersive.excel@gmail.com" <immersive.excel@gmail.com>)
List pgsql-general
Well after testing, this is what I found:

When you try to use ANYELEMENT parameters, and even just a VARIADIC
TEXT[] parameter to support the optional delimiter argument:

    FUNCTION GROUP_CONCAT_ATOM(ANYELEMENT, ANYELEMENT, VARIADIC
delimiters TEXT[])

when you go to create the aggregates, postgres runs through a
permutation of the argument types, just to be sure that all functions
are accounted for. And at that point postgres complains:

    function group_concat_atom(text, anyelement, text) does not exist

You would _think_ that the function definition above would cover this
case, but it for whatever reason it does not.

In the process of trying variations, I see that I used the deficient
nomenclature of "field" instead of "column" in the previous code. I will
fix that and post at the other site listed above; but other than that,
the code works and I welcome anyone to come up with a more compact
version that allows it to remain as flexible as it is now...



pgsql-general by date:

Previous
From: "ascot.moss@gmail.com"
Date:
Subject: pg_stat_replication became empty suddenly
Next
From: "immersive.excel@gmail.com"
Date:
Subject: Re: Seamless replacement to MySQL's GROUP_CONCAT function...