Re: WITHIN GROUP patch - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WITHIN GROUP patch
Date
Msg-id CA+Tgmoa91a2yW3D=+gzN0cGnzF7jo7xNW1ofXZX5ro5=xyQxaw@mail.gmail.com
Whole thread Raw
In response to Re: WITHIN GROUP patch  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
On Thu, Oct 10, 2013 at 10:35 PM, Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
> The first alternative that springs to mind is:
>
> ERROR: Incorrect number of arguments for hypothetical set function
> DETAIL: Number of hypothetical arguments (3) must equal number of ordered columns (2)

I'd suggest trying to collapse that down into a single message; the
DETAIL largely recapitulates the original error message.  Also, I'd
suggest identifying the name of the function, since people may not be
able to identify that easily based just on the fact that it's a
hypothetical set function.

Here's one idea, with two variants depending on the direction of the inequality:

ERROR: function "%s" has %d arguments but only %d ordering columns
ERROR: function "%s" has %d ordering columns but only %d arguments

Or else leave out the actual numbers and just state the principle, but
identifying the exact function at fault, e.g.

ERROR: number of arguments to function "%s" does not match number of
ordering columns

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



pgsql-hackers by date:

Previous
From: Huchev
Date:
Subject: Re: custom hash-based COUNT(DISTINCT) aggregate - unexpectedly high memory consumption
Next
From: Robert Haas
Date:
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE