Re: proposal for 8.5, listagg aggregate function, WIP patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal for 8.5, listagg aggregate function, WIP patch
Дата
Msg-id 10960.1261776556@sss.pgh.pa.us
обсуждение исходный текст
Ответ на proposal for 8.5, listagg aggregate function, WIP patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal for 8.5, listagg aggregate function, WIP patch
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> I propose a new aggregate function - listagg. This function
> concatenate values to string. If this function is used with two
> parameters, then second parameter is used as delimiter. NULL input
> values are ignored like other aggregates. If all values are NULL, then
> result is NULL. When delimiter is omitted, then values are
> concatenated without any delimiter.

The main objection I have to this proposal is the name: listagg seems
pretty horrid.  It's got nothing to do with lists, and it doesn't even
attempt to be consistent with other existing function names.

I can see a couple of different approaches that might make sense
for choosing a better name.  One is "something_to_string", though
I'm not sure what "something" should be --- maybe "rows" or "set"?
The other approach is to name it something based on concat() on the
grounds that it's a form of concatenation, and we do have "concat"
in the standard in the guise of XMLCONCAT.  For instance there's some
case for concat_agg() by analogy to array_agg(); though personally
I think array_agg() is a horrid name too and not one of the SQL
committee's better efforts.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Matteo Beccati
Дата:
Сообщение: PHP and PostgreSQL 8.5 compatibility
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal for 8.5, listagg aggregate function, WIP patch