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

From David E. Wheeler
Subject Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)
Date
Msg-id 63532B19-3890-4E80-B3A2-7148DFD11B1E@kineticode.com
Whole thread Raw
In response to Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)  (Thom Brown <thom@linux.com>)
List pgsql-hackers
On Aug 5, 2010, at 11:42 AM, Thom Brown wrote:

>>> LINE 1: select string_agg(f1 order by f1, ',') from text_tbl;
>>>               ^
>>
>> I'm confused: that looks like the two-argument form to me. Have I missed something?
>>
>>> HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
>>>
>>> It's not perfect (I don't think it's practical to get the HINT to
>>> read "Put the ORDER BY at the end" ;-)) but at least it should
>>> get people pointed in the right direction when they do this.
>>
>> It confuses the shit out of me. It says "string_agg(text)" doesn't exist when that clearly is not the name of the
functionyou've called. 
>>
>
> What function name do you believe was called?

The message says:
   string_agg(f1 order by f1, ',')

That looks like string_agg(text, text) or string_agg(anyelement, text).

Best,

David



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)
Next
From: "David E. Wheeler"
Date:
Subject: Re: Drop one-argument string_agg? (was Re: [BUGS] string_agg delimiter having no effect with order by)