Re: EMPTYING A DATABASE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: EMPTYING A DATABASE
Дата
Msg-id 17153.1272567395@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: EMPTYING A DATABASE  ("George Weaver" <gweaver@shaw.ca>)
Список pgsql-novice
"George Weaver" <gweaver@shaw.ca> writes:
> From: "Tom Lane":
> My thought would be to make use of multi-table TRUNCATE, assuming
> he's using a PG version new enough to have that.  Keep a script
> around with a TRUNCATE that lists all of the related tables in one
> command, and just run the script to reset.

> Wouldn't using pg_dump with the schema only option accomplish this?

Sure.  I assume the OP already thought of that, and was curious
about alternatives.  (One possible reason to prefer the TRUNCATE
approach though: you don't necessarily have to zap *every* table
in the database.)

            regards, tom lane

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

Предыдущее
От: "George Weaver"
Дата:
Сообщение: Re: EMPTYING A DATABASE
Следующее
От: Tony Day
Дата:
Сообщение: Long (really long) queries and not sure how to diagnose