Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h70BW-0007ic-T3 for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Mar 2019 16:04:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h70BT-0004v1-PT for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Mar 2019 16:04:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h70BT-0004sp-EP for pgsql-hackers@lists.postgresql.org; Thu, 21 Mar 2019 16:04:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h70BM-0001SA-2B for pgsql-hackers@lists.postgresql.org; Thu, 21 Mar 2019 16:04:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2LG4YBa021617; Thu, 21 Mar 2019 12:04:34 -0400 From: Tom Lane To: David Rowley cc: Pavel Stehule , PostgreSQL Hackers Subject: Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name In-reply-to: References: <15572-ed1b9ed09503de8a@postgresql.org> <155300941700.16480.7948036003189357692.pgcf@coridan.postgresql.org> Comments: In-reply-to David Rowley message dated "Thu, 21 Mar 2019 00:43:26 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21615.1553184274.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 21 Mar 2019 12:04:34 -0400 Message-ID: <21616.1553184274@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > [ drop_func_if_not_exists_fix_v9.patch ] Pushed with mostly-cosmetic adjustments. I noticed a couple of loose ends that are somewhat outside the scope of the bug report, but maybe are worth considering now: 1. There's some inconsistency in the wording of the error messages in these routines, eg errmsg("%s is not a function", vs errmsg("%s is not a procedure", vs errmsg("function %s is not an aggregate", Also there's errmsg("function name \"%s\" is not unique", where elsewhere in parse_func.c, we find errmsg("function %s is not unique", You didn't touch this and I didn't either, but maybe we should try to make these consistent? 2. Consider regression=3D# CREATE FUNCTION ambig(int) returns int as $$ select $1; $$ = language sql; CREATE FUNCTION regression=3D# CREATE PROCEDURE ambig() as $$ begin end; $$ language plpgs= ql; CREATE PROCEDURE regression=3D# DROP PROCEDURE ambig; ERROR: procedure name "ambig" is not unique HINT: Specify the argument list to select the procedure unambiguously. Arguably, because I said "drop procedure", there's no ambiguity here; but we don't account for objtype while doing the lookup. I'm inclined to leave point 2 alone, because we haven't had complaints about it, and because I'm not sure we could make it behave in a clean way given the historical ambiguity about what OBJECT_FUNCTION should match. But perhaps it's worth discussing. regards, tom lane