Обсуждение: sql command to drop everything

Поиск
Список
Период
Сортировка

sql command to drop everything

От
Bryan Irvine
Дата:
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

От
Bruce Momjian
Дата:
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

От
CoL
Дата:
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.