Re: drop table if exists

From: Kevin Coyner <kevin(at)rustybear(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: drop table if exists
Date: 2003-03-14 11:46:14
Message-ID: 20030314114614.GC20154@rustybear.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Mar 05, 2003 at 02:09:03PM -0500, Kevin Coyner wrote......

>
> In MySQL, when I create a new table from a .sql file, I usually start
> with:
>
> DROP TABLE IF EXISTS sometable;
> CREATE TABLE sometable(
>
>
> This doesn't work in Postgres and I haven't been able to find the
> equivalent in the docs. If I try to drop a table that doesn't exist, I
> get an error message, so having that modifier "... if exists ..." is
> nice.
>
> Is there an equivalent to "IF EXISTS" in Postgres?

No thoughts about this one?

Thanks
Kevin

--
Kevin Coyner
mailto: kevin(at)rustybear(dot)com
GnuPG key: 1024D/8CE11941

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Aarni Ruuhimäki 2003-03-14 12:17:04 Re: drop table if exists
Previous Message Vittorio Zuccala' 2003-03-14 11:11:49 Re: Pgaccess doesn't connect