Re: "truncate all"?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "truncate all"?
Дата
Msg-id 22159.1060092981@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "truncate all"?  (Andreas <e9625203@student.tuwien.ac.at>)
Список pgsql-hackers
Andreas <e9625203@student.tuwien.ac.at> writes:
> Agreed, workarounds are easy. The original suggestion of "TRUNCATE ALL"
> (or "TRUNCATE table CASCADE"), however, was motivated by the search for a
> simple and efficient truncation of all tables to accelerate unit-testing.

I still think the best suggestion for you is the one someone made
already: create a schema dump (pg_dump -s), then do DROP DATABASE,
CREATE DATABASE, load the schema dump.  This will be somewhat slower
than a hypothetical TRUNCATE ALL, but it has the great advantage that
your starting point is well-documented and guaranteed to be the same
on every iteration.  TRUNCATE ALL would provide no such guarantee.

And, of course, that solution exists today ...
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DROP TYPE/DROP DOMAIN
Следующее
От: Tom Lane
Дата:
Сообщение: Re: v7.4 Bundled ... please test ...