Re: Review: listagg aggregate

Поиск
Список
Период
Сортировка
От Takahiro Itagaki
Тема Re: Review: listagg aggregate
Дата
Msg-id 20100128175911.9791.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Review: listagg aggregate  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Review: listagg aggregate  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> wrote:

> 2010/1/28 Pavel Stehule <pavel.stehule@gmail.com>:
> > 2010/1/28 David E. Wheeler <david@kineticode.com>:
> >> On Jan 27, 2010, at 6:47 PM, Takahiro Itagaki wrote:
> >>
> >>> * I think we cannot cache the delimiter at the first call.
> >>>   For example,
> >>>     SELECT string_agg(elem, delim)
> >>>       FROM (VALUES('A', ','), ('B', '+'), ('C', '*')) t(elem, delim);
> >>>   should return 'A+B*C' rather than 'A,B,C'.
> >
> > no, has not.
> What is use case for this behave??

I also think this usage is nonsense, but seems to be the most consistent
behavior for me. I didn't say anything about use-cases, but just capability.
Since we allow such kinds of usage for now, you need to verify the
delimiter is not changed rather than ignoring it if you want disallow
to change the delimiter during an aggregation.

Of course you can cache the first delimiter at start, and check delimiters
are not changed every calls -- but I think it is just a waste of cpu cycle.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center




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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Patch: libpq new connect function (PQconnectParams)
Следующее
От: Tim Bunce
Дата:
Сообщение: Re: Add on_perl_init and proper destruction to plperl [PATCH]