From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Nina Marlow <postgresql.2020@t-net.ruhr>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16492: DROP VIEW IF EXISTS error
Date: Sun, 14 Jun 2020 13:12:15 -0400
Message-ID: <1050585.1592154735@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYkzKP17j1RS2ASL7oMnnbZW8qBb=kR3-e1Ug9QpnBvxw@mail.gmail.com>
References: <16492-2f002961054fd4a8@postgresql.org>
<CAKFQuwaCYa3Dx_dEcLfzUrUgcw_jOJ1Y_s-mGwkf0ENXt34XGg@mail.gmail.com>
<CAFj8pRCe1+eAF1+06O_qCgVwrxAXsQkznqG1yTZSK+qnC29-Dw@mail.gmail.com>
<187168644.20200613130633@smtp.mailbox.org>
<CAFj8pRDyZb9Rt6Dst_9uf+A2r0e2iQRkoys7+JeR9E-voPDNnQ@mail.gmail.com>
<CAKFQuwYkzKP17j1RS2ASL7oMnnbZW8qBb=kR3-e1Ug9QpnBvxw@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, pavel.stehule@gmail.com, postgresql.2020@t-net.ruhr, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16492: DROP VIEW IF EXISTS error
In-Reply-To: <1050585.1592154735@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox