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

Re: drop if exists remainder

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: drop if exists remainder
Date: 2006-02-05 18:29:56
Message-ID: 200602051829.k15ITuC25238@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Andrew Dunstan wrote:
> 
> 
> Tom Lane wrote:
> 
> >Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >  
> >
> >>Here's a first draft patch for DROP ... IF EXISTS for the remaining 
> >>cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, 
> >>AGGREGATE, OPERATOR, CAST and RULE.
> >>    
> >>
> >
> >At what point does this stop being useful and become mere bloat?
> >The only case I can ever recall being actually asked for was the
> >TABLE case ...
> >
> >
> >  
> >
> 
> Chris KL said it should be done for all on the grounds of consistency. 
> But I will happily stop right now if that's not the general view - I'm 
> only doing this to complete something I started.

I am thinking we should have IF EXISTS support for every object that has
CREATE OR REPLACE functionality, plus objects that have storage like
table and perhaps index.

However, I see CREATE ROLE doesn't have REPLACE functionality, so what
is the logic of when we need IF EXISTS and when we don't?  Perhaps they
all should have it, and the REPLACE is just for objects you want to
replace but keep existing linkage in place.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2006-02-05 19:00:33
Subject: Re: renseignement
Previous:From: Stephen FrostDate: 2006-02-05 17:53:01
Subject: Re: Krb5 & multiple DB connections

pgsql-patches by date

Next:From: Andrew DunstanDate: 2006-02-05 19:58:19
Subject: Re: drop if exists remainder
Previous:From: Stephen FrostDate: 2006-02-05 17:53:01
Subject: Re: Krb5 & multiple DB connections

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