Search Postgresql Archives

Re: truncate all tables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/29/05, Zlatko Matić <zlatko.matic1@xxxxxxxxxxx> 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
---------------------------(end of broadcast)---------------------------TIP 6: Have you searched our list archives?
               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux