Re: Chatter on DROP SOMETHING IF EXISTS

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Chatter on DROP SOMETHING IF EXISTS
Date: 2007-02-08 17:54:33
Message-ID: 200702081854.33886.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Peter Eisentraut wrote:
> > What is the practical purpose of the notices emitted by DROP
> > SOMETHING IF EXISTS when the object in fact does not exist?
>
> It was asked for ...

The argument was that MySQL does the same. Which is valid but not
overriding.

I'm honestly looking for some practical use of this. We have debated
other NOTICE messages over the years, but they at least tell you
something you can use after the command. In this case, it just tells
you that the object which you wanted removed no matter what didn't
exist in the first place, but the state after the command (which is the
interesting side) is always the same: "gone". The only use case I see
is informing about typos, but the system generally doesn't cater to
that.

The downside is that while I wanted to use the IF EXISTS form to reduce
the chatter at the beginning of schema loading scripts, this just gives
me a different spelling of that same chatter.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-02-08 18:00:05 Re: Chatter on DROP SOMETHING IF EXISTS
Previous Message Marc Munro 2007-02-08 17:44:43 Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)