Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alex Hunsaker <badalex(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)
Date: 2010-08-05 18:47:11
Message-ID: 63532B19-3890-4E80-B3A2-7148DFD11B1E@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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 function you'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


In response to

pgsql-hackers by date

Next:From: David E. WheelerDate: 2010-08-05 18:47:58
Subject: Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)
Previous:From: Tom LaneDate: 2010-08-05 18:45:49
Subject: Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)

pgsql-bugs by date

Next:From: David E. WheelerDate: 2010-08-05 18:47:58
Subject: Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)
Previous:From: Nacho MezzadraDate: 2010-08-05 18:46:53
Subject: BUG #5603: pg_tblspc and pg_twoface directories get deleted when starting up service

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group