Re: Seamless replacement to MySQL's GROUP_CONCAT function...

From: "immersive(dot)excel(at)gmail(dot)com" <immersive(dot)excel(at)gmail(dot)com>
To: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, x3v0-pgsql(at)yahoo(dot)com, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>
Subject: Re: Seamless replacement to MySQL's GROUP_CONCAT function...
Date: 2013-08-05 23:56:48
Message-ID: 52003BC0.6070806@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message immersive.excel@gmail.com 2013-08-06 00:24:49 Re: Seamless replacement to MySQL's GROUP_CONCAT function...
Previous Message Merlin Moncure 2013-08-05 22:32:41 Re: Possible bug with row_to_json