Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkWBE-00062H-2M for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Jun 2020 17:12:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jkWBA-0003VK-6o for pgsql-bugs@arkaria.postgresql.org; Sun, 14 Jun 2020 17:12:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkWBA-0003VD-0H for pgsql-bugs@lists.postgresql.org; Sun, 14 Jun 2020 17:12:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkWB7-0008Gy-Tp for pgsql-bugs@lists.postgresql.org; Sun, 14 Jun 2020 17:12:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05EHCF2h1050586; Sun, 14 Jun 2020 13:12:15 -0400 From: Tom Lane To: "David G. Johnston" cc: Pavel Stehule , Nina Marlow , PostgreSQL mailing lists Subject: Re: BUG #16492: DROP VIEW IF EXISTS error In-reply-to: References: <16492-2f002961054fd4a8@postgresql.org> <187168644.20200613130633@smtp.mailbox.org> Comments: In-reply-to "David G. Johnston" message dated "Sun, 14 Jun 2020 09:19:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1050584.1592154735.1@sss.pgh.pa.us> Date: Sun, 14 Jun 2020 13:12:15 -0400 Message-ID: <1050585.1592154735@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > How is the proposed behavior more risky? And no, the current behavior does > not have any uniquely practical use. Its only benefit is that it is how > things have worked forever and that is only because its flaws are rarely > encountered in practice. I'm a little skeptical about the proposed change being of any benefit. The usual reason for doing DROP IF EXISTS is that you're about to replace the object. It will not help for the DROP to succeed if the conflicting object is still there, because the CREATE is going to fail anyway. Thus, the most likely effect of such a change is that we fix no scripts, while breaking any scripts that were dependent on the existing behavior. What I'd prefer to see, I think, is a command DROP RELATION [IF EXISTS] that is entirely un-picky about the object's relkind. Once upon a time DROP TABLE worked that way, IIRC, but it was "improved" with little thought about the needs of schema-update scripts. regards, tom lane