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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Alex Hunsaker <badalex(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, 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 19:18:07
Message-ID: AANLkTi=ybu2ZULXa+74LxH7WvT+mGBi3PFAEx60QiCVz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Aug 5, 2010 at 3:16 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Josh Berkus <josh(at)agliodbs(dot)com> writes:
>>> Well, maybe we need to expend some more sweat on the error message then.
>>> But this patch was still a prerequisite thing, because without it there
>>> is no error that we can complain about.
>
>> Yes, I'd say an addition to the HINT is in order *assuming* at that
>> stage we can tell if the user passed an ORDER BY or not.
>
> I was just looking at this, and realized I was mistaken earlier: the
> error is issued in ParseFuncOrColumn, which already is passed the
> agg_order list, so actually it's completely trivial to tell whether
> a variant error message is appropriate.  I suggest that we key it off
> there being not just an ORDER BY, but an ORDER BY with more than one
> element; if there's only one then this cannot be the source of
> confusion.
>
> Next question: exactly how should the variant HINT be phrased?
> I'm inclined to drop the bit about explicit casts and make it read
> something like
>
> HINT: No aggregate function matches the given name and argument
> types. Perhaps you misplaced ORDER BY; ORDER BY must appear after all
> regular arguments of the aggregate.

Could we arrange to emit this error message only when there is an
aggregate with the same name but different arguments?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David E. Wheeler 2010-08-05 19:20:06 Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)
Previous Message Tom Lane 2010-08-05 19:16:01 Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2010-08-05 19:20:06 Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)
Previous Message Tom Lane 2010-08-05 19:16:01 Re: [HACKERS] Drop one-argument string_agg? (was Re: string_agg delimiter having no effect with order by)