Re: truncate all tables? - Mailing list pgsql-general

From Doug Bloebaum
Subject Re: truncate all tables?
Date
Msg-id caa2de8a0506290720153af755@mail.gmail.com
Whole thread Raw
In response to truncate all tables?  (Zlatko Matić <zlatko.matic1@sb.t-com.hr>)
List 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 by date:

Previous
From: Matt Miller
Date:
Subject: CVS Build - No Doc
Next
From: Sven Willenberger
Date:
Subject: Re: PostgreSQL's vacuumdb fails to allocate memory for