sql command to drop everything

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

sql command to drop everything

От:
Bryan Irvine <bryan.irvine@kingcountyjournal.com>
Дата:
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 <pgman@candle.pha.pa.us>
Дата:
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 <col@mportal.hu>
Дата:
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.
FAQ