Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name

David Rowley <david.rowley@2ndquadrant.com>

From: David Rowley <david.rowley@2ndquadrant.com>
To: Arthur Zakirov <a.zakirov@postgrespro.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@2ndquadrant.com>, Ash M <makmarath@hotmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-02-17T22:15:19Z
Lists: pgsql-bugs, pgsql-hackers
On Fri, 15 Feb 2019 at 02:42, Arthur Zakirov <a.zakirov@postgrespro.ru> wrote:
> If nargs as -1 and noError as true can be passed only within
> RemoveObjects() I wonder, could we just end up with a patch which raise
> an error at every ambiguity? That is I mean the following patch:
>
> diff --git a/src/backend/parser/parse_func.c
> b/src/backend/parser/parse_func.c
> index 5222231b51..cce8f49f52 100644
> --- a/src/backend/parser/parse_func.c
> +++ b/src/backend/parser/parse_func.c
> @@ -2053,7 +2053,6 @@ LookupFuncName(List *funcname, int nargs, const
> Oid *argtypes, bool noError)
>          {
>              if (clist->next)
>              {
> -               if (!noError)
>                      ereport(ERROR,
>                              (errcode(ERRCODE_AMBIGUOUS_FUNCTION),
>                               errmsg("function name \"%s\" is not unique",
>
> But I may overlook something of course.

I had the same thoughts so I did that in the original patch, but see
Tom's comment which starts with "I don't like that a bit"

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Commits

  1. Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/ROUTINE.