Re: truncate all tables?

Поиск
Список
Период
Сортировка
От Doug Bloebaum
Тема Re: truncate all tables?
Дата
Msg-id caa2de8a0506290720153af755@mail.gmail.com
обсуждение исходный текст
Ответ на truncate all tables?  (Zlatko Matić <zlatko.matic1@sb.t-com.hr>)
Список pgsql-general
On 6/29/05, Zlatko Matić <zlatko.matic1@sb.t-com.hr> wrote:
>
> How could I truncate, delete all content of all tables in one step ?

You could use a query to generate the statements in psql:

\t
\o trunc_all.out

SELECT 'TRUNCATE ' || table_name || ';'
  FROM information_schema.tables
 WHERE table_schema='my_schema_name'
   AND table_type='BASE TABLE';

\t
\o

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

Предыдущее
От: Matt Miller
Дата:
Сообщение: CVS Build - No Doc
Следующее
От: Sven Willenberger
Дата:
Сообщение: Re: PostgreSQL's vacuumdb fails to allocate memory for