Re: string_agg delimiter having no effect with order by

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thom Brown <thom(at)linux(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Alex Hunsaker <badalex(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: string_agg delimiter having no effect with order by
Date: 2010-08-05 17:30:19
Message-ID: AANLkTikRU+165S6QQM60W1Gk-CtYtEdEkiOtPgWLYDJp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

2010/8/5 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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
>

ok

Regards

Pavel Stehule

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2010-08-05 17:41:01 Re: BUG #5599: Vacuum fails due to index corruption issues
Previous Message Tom Lane 2010-08-05 17:19:41 Re: BUG #5599: Vacuum fails due to index corruption issues

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-08-05 17:31:37 Re: Concurrent MERGE
Previous Message Tom Lane 2010-08-05 17:28:41 Re: Two different methods of sneaking non-immutable data into an index