Re: drop all tables in db - without dropdb ?!

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: drop all tables in db - without dropdb ?!
Дата
Msg-id 200408241254.19075.josh@agliodbs.com
обсуждение исходный текст
Ответ на drop all tables in db - without dropdb ?!  (Tom Tom <luondor@yahoo.com>)
Список pgsql-novice
Tom tom,

> i would like to drop all tables in a database without
> having to issue individual drop-statements for every
> table.
> is there a command that can do this?

If you're usng 7.4, you can drop the public schema, which will drop all
objects in it:

DROP SCHEMA public CASCADE;

However, you may not have permission to do that either.   In that case, no,
you're stuck with one-by-one dropping.   I suggest either getting greater
permissions, or writing a quick script in Perl.

--
Josh Berkus
Aglio Database Solutions
San Francisco

В списке pgsql-novice по дате отправления:

Предыдущее
От: michael@floog.net
Дата:
Сообщение: Re: DATE column doesn't like empty string or null value
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: drop all tables in db - without dropdb ?!