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

Re: drop if exists

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
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 14:53:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
On Nov 14, 2005, at 23:25 , Andrew Dunstan wrote:

> Ther attached patch is for comment. It implements "drop if exists"  
> as has recently been discussed. Illustration:

Nifty! Thanks for working this up, Andrew!

> andrew=# drop table blurflx;
> ERROR:  table "blurflx" does not exist
> andrew=# drop table if exists blurflx;

I'm not sure what other DBMS' return in this situation (and kindly  
ignore this suggestion if it's specified or otherwise determined),  
but perhaps the output could be TABLE "blurlx" DOES NOT EXIST  
(without the ERROR) or something more informative, rather than DROP  
TABLE. It reminds me of the old behavior of outputting COMMIT even in  
the case of transaction failure. I find the current behavior of  
outputting ROLLBACK in the case of transaction failure more useful.

Michael Glaesemann
grzm myrealbox com

In response to

pgsql-patches by date

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

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