Skip site navigation (1) Skip section navigation (2)

Re: drop if exists

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: drop if exists
Date: 2005-11-14 15:21:50
Message-ID: 11272.1131981710@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> andrew=# drop table blurflx;
> ERROR:  table "blurflx" does not exist
> andrew=# drop table if exists blurflx;
> DROP TABLE

If I read MySQL's documentation correctly, they emit a NOTE (equivalent
of a NOTICE message I suppose) when IF EXISTS does nothing because the
table doesn't exist.  Seems like we should do likewise --- your second
example here seems actively misleading.  That is, I'd rather see

andrew=# drop table if exists blurflx;
NOTICE:  table "blurflx" does not exist, skipping
DROP TABLE


			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Andrew DunstanDate: 2005-11-14 17:06:30
Subject: Re: drop if exists
Previous:From: Dave PageDate: 2005-11-14 15:12:04
Subject: Re: drop if exists

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group