Re: drop if exists - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: drop if exists
Date
Msg-id 20051015152003.GD14113@svana.org
Whole thread Raw
In response to Re: drop if exists  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: drop if exists
List pgsql-hackers
On Fri, Oct 14, 2005 at 10:32:02PM -0300, Alvaro Herrera wrote:
> What about "CREATE IF NOT EXISTS" (CINE)?  If we support DROP IF EXISTS
> (DIE), is the other one going to be supported too?

CINE already exists sortof, it's called CREATE OR REPLACE. Although the
effect is obvious for functions, it seems to me that it would be cool
to make a CREATE OR REPLACE TABLE that simply does nothing if the table
already exists with the right format.

ISTM that most of the sitautions people are talking about here ivolving
recreating the table exactly as is directly afterwards.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: drop if exists
Next
From: Tom Lane
Date:
Subject: Re: slow IN() clause for many cases