From: Alastair Turner on
On Tue, Jan 26, 2010 at 1:23 PM, Alastair Turner <bell(a)ctrlf5.co.za> wrote:
> .....
>
> Given that it potentially produces a delimited list, not a straight
> conacatenation (and that list is unacceptable since it would be
> descriptive as a noun but not as a verb) would implode_agg not be the
> most descriptive name?
>

Actually, scratch that. The other *agg functions are named for what
they produce as output. Not for their process - as per the objection
to list_agg and suggestions of conact_agg and implode_agg. string_agg
would be consistent, which is a wonderful thing if you can get it in a
naming scheme.

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Peter Eisentraut on
On tis, 2010-01-26 at 03:08 -0800, David E. Wheeler wrote:
> On Jan 25, 2010, at 23:14, Pavel Stehule <pavel.stehule(a)gmail.com>
> wrote:
>
> > why is concat_agg better than listagg ?
>
> Because it's an aggregate that cocatenates values. It's not an
> aggregate that lists things. I also like concat_agg better than
> string_agg because it's not limited to acting on strings.

What else can it act on?


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
On Tue, Jan 26, 2010 at 2:14 AM, Pavel Stehule <pavel.stehule(a)gmail.com> wrote:
> 2010/1/25 Robert Haas <robertmhaas(a)gmail.com>:
>> On Mon, Jan 25, 2010 at 2:27 PM, David E. Wheeler <david(a)kineticode.com> wrote:
>>> On Jan 25, 2010, at 2:09 AM, Peter Eisentraut wrote:
>>>> xmlagg -> concatenates values to form xml datum
>>>> array_agg -> concatenates values to form array datum
>>>> ??? -> concatenates values to form string datum
>>>
>>> concat_agg().
>>
>> I like that one...
>
> why is concat_agg better than listagg ?

Because it doesn't make lists.

Honestly, I don't love concat_agg() either - why should something need
to have agg in the name just because it's an aggregate? I think the
most descriptive name would be something like
concatenate_with_separator(), but that's kind of long.

....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Pavel Stehule on
2010/1/26 Robert Haas <robertmhaas(a)gmail.com>:
> On Tue, Jan 26, 2010 at 2:14 AM, Pavel Stehule <pavel.stehule(a)gmail.com> wrote:
>> 2010/1/25 Robert Haas <robertmhaas(a)gmail.com>:
>>> On Mon, Jan 25, 2010 at 2:27 PM, David E. Wheeler <david(a)kineticode.com> wrote:
>>>> On Jan 25, 2010, at 2:09 AM, Peter Eisentraut wrote:
>>>>> xmlagg -> concatenates values to form xml datum
>>>>> array_agg -> concatenates values to form array datum
>>>>> ??? -> concatenates values to form string datum
>>>>
>>>> concat_agg().
>>>
>>> I like that one...
>>
>> why is concat_agg better than listagg ?
>
> Because it doesn't make lists.
>
> Honestly, I don't love concat_agg() either - why should something need
> to have agg in the name just because it's an aggregate?  I think the
> most descriptive name would be something like
> concatenate_with_separator(), but that's kind of long.

This is never ending story :)

MySQL has function concate_ws - but this function has different semantic.

I thing so string_agg is short, and from one view consistent

Pavel

>
> ...Robert
>

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "David E. Wheeler" on
On Jan 26, 2010, at 4:03, Peter Eisentraut <peter_e(a)gmx.net> wrote:

> What else can it act on?

Any data type, since they all can be converted to text. Integers would
be a common choice.

David

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers