Thread: sql command to drop everything

sql command to drop everything

From
Bryan Irvine
Date:
Is there a SQL command to delete everything (including the tables) from
a db?  Not a complete drop so that the db doesn't exist anymore, but
just so that there's nothing in it.

--Bryan


Re: sql command to drop everything

From
Bruce Momjian
Date:
Bryan Irvine wrote:
> Is there a SQL command to delete everything (including the tables) from
> a db?  Not a complete drop so that the db doesn't exist anymore, but
> just so that there's nothing in it.

Nope, just drop/recreate.  It is faster.

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

Re: sql command to drop everything

From
CoL
Date:
Hi,

Bryan Irvine wrote, On 12/6/2003 2:04 AM:

> Is there a SQL command to delete everything (including the tables) from
> a db?  Not a complete drop so that the db doesn't exist anymore, but
> just so that there's nothing in it.

you can drop the schema.

drop schema NAME cascade;

C.