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 1h7WTg-000327-Mu for pgsql-committers@arkaria.postgresql.org; Sat, 23 Mar 2019 02:33:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7WTf-0005Mc-0a for pgsql-committers@arkaria.postgresql.org; Sat, 23 Mar 2019 02:33:43 +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 1h7WTc-0005MU-Sc for pgsql-committers@lists.postgresql.org; Sat, 23 Mar 2019 02:33:42 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7WTZ-0006zq-Iq for pgsql-committers@lists.postgresql.org; Sat, 23 Mar 2019 02:33:39 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5173F21BE2; Fri, 22 Mar 2019 22:33:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 22 Mar 2019 22:33:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=a NuhGB3ih7FAHGjx3NOP2Rj+pcBUKwobS4uZrgL6Al8=; b=fUwbRMQ2tewuLt3zH CSgx+4bA91QCQfErL/IxEXsxwXr8lCvmj9OslQ1uF/LxgUou5H/GUlJqdTVt2CMl 5S6GpnefkbckmyRVsn3C7OqztB97L45As9G3PpbSYnYY7dhCeB9Jp0/UkuFMouiJ DO4FncsWhzCoBfIvZxqQ9ElB3hGWKfGky8Gj52yvCuxBIkQPTv3Z5lz9ddOPhOUy 6/V2WKuEut+4PXmeVr5WJg2PwD45rHNn/IZc1bPxBHC1bCwpo5d9nsBGEYzTm9jg UFqiU0oLVLP7T+Y7rkrkCFyRL20kWwUFrsGyK6+dCbIO+4delmLwjOQALtxwYIXF 7Pa/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=aNuhGB3ih7FAHGjx3NOP2Rj+pcBUKwobS4uZrgL6A l8=; b=cuIvCcCZXkmnRGTnVuoppjI4ETToKSKAnTHf4FiMTTbVi0xExmotcfVvF GX2jAEPABD0QDGA7V0WKSfLdmiScSOxOrfDrw5JSzgzkw4jiL9XgwjQVsWQR6FX1 QMBs8Iua4diIWkaFM+s3W+aWHcXBIZhCDYhHUrYSz2T+MoMizmfWLCDQlRYWGpvd om0nlq8SHadiA6K2Xb2wXRQT6u6IOwvizWXhcyOhTYezPe8I98hOkl4aUO9vMYaM FYUrx9FoNRi3rJXR2L7oRYTI17Mt55OwpctWd9inoG3P55i42GcUK08f0cmFDDI5 QxQkszw9imO9KckQ40M1pnWGylZjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrjedvgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucffohhmrg hinhepphhoshhtghhrrdgvshenucfkphepleekrddvuddtrddugedtrddujedunecurfgr rhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvgenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 74E1A10310; Fri, 22 Mar 2019 22:33:35 -0400 (EDT) Date: Fri, 22 Mar 2019 19:33:33 -0700 From: Andres Freund To: Tom Lane , David Rowley Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/RO Message-ID: <20190323023333.tpovylk54modtlss@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-03-21 15:52:23 +0000, Tom Lane wrote: > Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/ROUTINE. > > These commands allow the argument type list to be omitted if there is > just one object that matches by name. However, if that syntax was > used with DROP IF EXISTS and there was more than one match, you got > a "function ... does not exist, skipping" notice message rather than a > truthful complaint about the ambiguity. This was basically due to > poor factorization and a rats-nest of logic, so refactor the relevant > lookup code to make it cleaner. > > Note that this amounts to narrowing the scope of which sorts of > error conditions IF EXISTS will bypass. Per discussion, we only > intend it to skip no-such-object cases, not multiple-possible-matches > cases. > > Per bug #15572 from Ash Marath. Although this definitely seems like > a bug, it's not clear that people would thank us for changing the > behavior in minor releases, so no back-patch. > > David Rowley, reviewed by Julien Rouhaud and Pavel Stehule > > Discussion: https://postgr.es/m/15572-ed1b9ed09503de8a@postgresql.org I now get: /home/andres/src/postgresql/src/backend/parser/parse_func.c: In function ‘LookupFuncWithArgs’: /home/andres/src/postgresql/src/backend/parser/parse_func.c:2285:5: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (objtype) ^~~~~~ /home/andres/src/postgresql/src/backend/parser/parse_func.c:2336:4: note: here case FUNCLOOKUP_AMBIGUOUS: ^~~~ which seems like a somewhat righteous complaint? I'd just add a break to silence it (which can't be reached, because all paths ought to error out). Greetings, Andres Freund