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

drop if exists

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: drop if exists
Date: 2005-11-14 14:25:49
Message-ID: 43789E6D.9040009@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-patches
Ther attached patch is for comment. It implements "drop if exists" as 
has recently been discussed. Illustration:

andrew=# drop table blurflx;
ERROR:  table "blurflx" does not exist
andrew=# drop table if exists blurflx;
DROP TABLE
andrew=# create table blurflx ( x text);
CREATE TABLE
andrew=# drop table if exists blurflx;
DROP TABLE
andrew=# drop table blurflx;
ERROR:  table "blurflx" does not exist
andrew=#

If the patch is acceptable I will work up some documentation and 
regression tests.

cheers

andrew

Attachment: drop-if-exists.patch
Description: text/x-patch (16.7 KB)

Responses

pgsql-patches by date

Next:From: Michael GlaesemannDate: 2005-11-14 14:53:45
Subject: Re: drop if exists
Previous:From: Andrew DunstanDate: 2005-11-13 16:12:19
Subject: Re: Multi-table-unique-constraint

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