Re: string_agg delimiter having no effect with order by - Mailing list pgsql-bugs

From Tom Lane
Subject Re: string_agg delimiter having no effect with order by
Date
Msg-id 2631.1281023222@sss.pgh.pa.us
Whole thread Raw
In response to Re: string_agg delimiter having no effect with order by  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: string_agg delimiter having no effect with order by  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-bugs
Pavel Stehule <pavel.stehule@gmail.com> writes:
> but still when we remove one parametric string_agg, then this issue
> will not be documented.

How so?  This paragraph will still be there:

   <para>
    When dealing with multiple-argument aggregate functions, note that the
    <literal>ORDER BY</> clause goes after all the aggregate arguments.
    For example, this:
<programlisting>
SELECT string_agg(a, ',' ORDER BY a) FROM table;
</programlisting>
    not this:
<programlisting>
SELECT string_agg(a ORDER BY a, ',') FROM table;  -- incorrect
</programlisting>
    The latter is syntactically valid, but it represents a call of a
    single-argument aggregate function with two <literal>ORDER BY</> keys
    (the second one being rather useless since it's a constant).
   </para>


            regards, tom lane

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: string_agg delimiter having no effect with order by
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #5599: Vacuum fails due to index corruption issues