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 1ggWI9-0004FN-RA for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 14:54:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggWI8-0002hu-23 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 14:54:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggWI7-0002hn-Nv for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 14:54:11 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggWI4-0000bS-Ik for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 14:54:11 +0000 Received: by mail-qk1-x744.google.com with SMTP id y16so376131qki.7 for ; Mon, 07 Jan 2019 06:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AHHJQytCQB7sOfp8YQn7dNmTVbpX4JtR6iJpg5zf2ws=; b=ACRtductZ1Lib/0f8I2hd++yPXMQsN2cdax1QBVb1VFFwpaAMb2gDO8zib7JUYgKs/ VfnBxaPL3D3KU3s4Tm9SkpX+pP0L59V4cTb+2ZltXEnZKa3i4FxoWGTz1/BJWqyiHqbz YNUpJbiPMl2m2gvYRdzs5Xgm64Ssa65uNYSP3zMudS5W2etXztKxzocnz5iSh/1+iCUE cDg1MtbPuoyN+BSpwT6rGcDUqPfThHyUaXBhmSd+qY+kQZIqW/5k+/Nysx4qKUSwmf77 +cQ8SiAbtOC/v3htj0Q6+AolWr3vKmAmAXpHtc0V2vio6ZGhcJ8g5zqQLNoaulzEAl5/ O1lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=AHHJQytCQB7sOfp8YQn7dNmTVbpX4JtR6iJpg5zf2ws=; b=rHloaEJRoHoyQf4Y8OJ21tenZtXVHCXdbyB79rf3ETbBhrUpuQlGBu+inp2GTbcalp FmqgCXW+Oiw3bANjxByQgFTb6iDzbTZ0nOXz9zOg1x97rQIK57z5xC9qj9nOkctokrNO xpE9LZ9W29PzsvePoZHhgdvizl2NW/TnbG9ROYXnXiJ4+Qa3qa113RZdIHxx4ieOF9oy zLcC/fqUwg3JC6R2llHhDbVe12Wj7RxPVfweXbJpLeUEalYiUrJ4hj2XfFNEzcAcwjtk Ra+mBKiQd65UpBiXtlExB4jO/UIm3IKPmVvwMk1Ge5cdVKLU2POM8XGeqoWJ3x/pOGK3 a3YA== X-Gm-Message-State: AJcUukcjWT9tyEULizX8vooWJMG3agQssdajrV1LXroqnXCApVdK+pYc nVyj9OYrqM3wQetXoZ6u+mw9ew== X-Google-Smtp-Source: ALg8bN6aVF+mpomnRhq239ronXftWC1GwuGpAnXZA4cNS8Ac242FG80gvyplpnv25ONCshbd+rmrGA== X-Received: by 2002:a37:2d07:: with SMTP id t7mr22265189qkh.136.1546872846361; Mon, 07 Jan 2019 06:54:06 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id j38sm40227453qtj.72.2019.01.07.06.54.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Jan 2019 06:54:05 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id B2AA89A8; Mon, 7 Jan 2019 11:54:03 -0300 (-03) Date: Mon, 7 Jan 2019 11:54:03 -0300 From: Alvaro Herrera To: David Rowley Cc: makmarath@hotmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name Message-ID: <201901071454.wxkoyoq4s5qp@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-04, David Rowley wrote: > It's not really that clear to me that doing that would be any more > correct than the alternative. I think it would be. Specifying a function without params works only if it's unambiguous; if ambiguity is possible, raise an error. On the other hand, lack of IF EXISTS is supposed to raise an error if the function doesn't exist; its presence means not the report that particular error, but it doesn't mean to suppress other errors such as the ambiguity one. I'm not sure what's a good way to implement this, however. Maybe the solution is to have LookupFuncName return InvalidOid when the function name is ambiguous and let LookupFuncWithArgs report the error appropriately. I think this behavior is weird: /* * When looking for a function or routine, we pass noError through to * LookupFuncName and let it make any error messages. Otherwise, we make * our own errors for the aggregate and procedure cases. */ oid = LookupFuncName(func->objname, func->args_unspecified ? -1 : argcount, argoids, (objtype == OBJECT_FUNCTION || objtype == OBJECT_ROUTINE) ? noError : true); -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services