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: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, x3v0-pgsql(at)yahoo(dot)com, 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-06 05:41:06
Message-ID: 52008C72.7040508@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You're saying as oppose to straight SQL? I don't think so; but I had
defined it as such just in case there was some functional benefit that I
might be unaware of...

========================
On 08/06/2013 01:26 AM, Alvaro Herrera wrote:
> Pavel Stehule escribió:
>
>> you code can be translated to
>>
>> CREATE OR REPLACE
>> FUNCTION GROUP_CONCAT_ATOM(field1 TEXT, field2 TEXT, delimiter TEXT)
>> RETURNS TEXT AS $$
>> BEGIN
>> RETURN COALESCE(field1||delimiter||field2, field2, field1);
>> END;
>> $$ LANGUAGE plpgsql;
> Actually you don't even need plpgsql for this, do you ..
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-08-06 05:47:47 Re: Seamless replacement to MySQL's GROUP_CONCAT function...
Previous Message ascot.moss@gmail.com 2013-08-06 05:33:41 Re: pg_stat_replication became empty suddenly