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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Alex Hunsaker <badalex(at)gmail(dot)com>, Thom Brown <thom(at)linux(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:25:35
Message-ID: 27107.1281032735@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

I wrote:
> Well, I forgot that an aggregate involves more than one catalog row ;-).
> So it's a bit bigger patch than that, but still pretty small and safe.
> See attached.

Applied to HEAD and 9.0. The mistaken case will now yield this:

regression=# select string_agg(f1 order by f1, ',') from text_tbl;
ERROR: function string_agg(text) does not exist
LINE 1: select string_agg(f1 order by f1, ',') from text_tbl;
^
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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2010-08-05 18:28:35 Re: BUG #5599: Vacuum fails due to index corruption issues
Previous Message Tom Lane 2010-08-05 18:01:15 Re: BUG #5599: Vacuum fails due to index corruption issues

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-08-05 18:28:35 Re: BUG #5599: Vacuum fails due to index corruption issues
Previous Message Andrew Dunstan 2010-08-05 18:24:40 Re: remove upsert example from docs