A (final?) version using COALESCE (It wasn't too long to
post at the blog now; I am also posting here for belt
and suspenders reasons...):
-- group_concat.sql
-- permutation of GROUP_CONCAT parameter types with
delimiter parameter furnished:
CR
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
>
/2013 12:49 AM, Pavel Stehule wrote:
> Hello
>
> 2013/8/3 immersive.ex...@gmail.com :
>> I needed a GROUP_CONCAT to port some queries to postgres.
>>
>> In discussions online, I found repeated advice for rewriting the queries,
>> but no solid way to formulate the GR
No luck on posting at that blog; comments are limited to X characters.
Here is the final version with the minor update to the variable names
and comments:
-- group_concat.sql
-- permutation of GROUP_CONCAT parameter types with delimiter parameter
furnished:
CREATE OR REPLACE
FUNCTION GROUP_CONCAT
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, post
.html
There's already a GROUP_CONCAT, listed there, but I guess this
one was lacking in some way.
On Mon, Aug 5, 2013 at 10:04 AM, Alvaro Herrera <alvhe...@2ndquadrant.com>
wrote:
immersive
:04 PM, Alvaro Herrera wrote:
> immersive.ex...@gmail.com escribió:
>
>> Note: I found some close-but-no cigar aggregates shared online, but
>> they would not accept integer arguments, nor would they handle the
>> optionally furnished delimiter. People woul
I needed a GROUP_CONCAT to port some queries to postgres.
In discussions online, I found repeated advice for rewriting the
queries, but no solid way to formulate the GROUP_CONCAT as a
postgres function. Rewrite perhaps hundreds of queries that happen
to be in the app