Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)
Date
Msg-id 16862.1280963260@sss.pgh.pa.us
Whole thread Raw
In response to Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)  (Alex Hunsaker <badalex@gmail.com>)
Responses Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)  (Robert Haas <robertmhaas@gmail.com>)
Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-hackers
Alex Hunsaker <badalex@gmail.com> writes:
> I dunno about anyone else but (a, ',' order by a) just looks weird.

I suppose, but aren't you just focusing on the argument being constant?
In the more general case I don't think there's anything unnatural about
this syntax.

> Or in other words, any thoughts on:
> select string_agg(delim, expression);

That looks pretty weird to me anyway, with or without use of ORDER BY.
Nobody would think to write the delimiter first.  Usually you put the
"most important" argument first, and no one would see the delimiter
as the most important one.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Two different methods of sneaking non-immutable data into an index
Next
From: Robert Haas
Date:
Subject: Re: more numeric stuff