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

From Pavel Stehule
Subject Re: string_agg delimiter having no effect with order by
Date
Msg-id AANLkTikRU+165S6QQM60W1Gk-CtYtEdEkiOtPgWLYDJp@mail.gmail.com
Whole thread Raw
In response to Re: string_agg delimiter having no effect with order by  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
2010/8/5 Tom Lane <tgl@sss.pgh.pa.us>:
> 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? =C2=A0This paragraph will still be there:
>
> =C2=A0 <para>
> =C2=A0 =C2=A0When dealing with multiple-argument aggregate functions, not=
e that the
> =C2=A0 =C2=A0<literal>ORDER BY</> clause goes after all the aggregate arg=
uments.
> =C2=A0 =C2=A0For example, this:
> <programlisting>
> SELECT string_agg(a, ',' ORDER BY a) FROM table;
> </programlisting>
> =C2=A0 =C2=A0not this:
> <programlisting>
> SELECT string_agg(a ORDER BY a, ',') FROM table; =C2=A0-- incorrect
> </programlisting>
> =C2=A0 =C2=A0The latter is syntactically valid, but it represents a call =
of a
> =C2=A0 =C2=A0single-argument aggregate function with two <literal>ORDER B=
Y</> keys
> =C2=A0 =C2=A0(the second one being rather useless since it's a constant).
> =C2=A0 </para>
>
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0regards, tom lane
>

ok

Regards

Pavel Stehule

pgsql-bugs by date:

Previous
From: Thom Brown
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