Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter
Дата
Msg-id 25917.1405520402@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #10972: string_agg function incorrectly concatenating varying delimiter  (jeff@goaldriven.com)
Ответы Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter  (Jeff Fischer <jeff@goaldriven.com>)
Список pgsql-bugs
jeff@goaldriven.com writes:
> Running the query below will show how the delimiter for the current row is
> actually the subsequent rows delimiter.

Hmm, well, the documentation for string_agg doesn't say what happens when
the "delimiter" argument varies across rows; but a quick look at the code
finds that the first-call delimiter isn't actually used at all, and on
subsequent calls the delimiter is appended to the running result before
the associated value is.  Which seems to me to be at least as reasonable,
and certainly a great deal easier to implement, as what you seem to have
in mind.  Can you offer a principled argument why it should be the other
way around?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Documentation problem: The syntax for "\copy" is just wrong
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Disable View rule