Re: Function to total reset a schema - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Function to total reset a schema
Date
Msg-id BANLkTinCSruCqUFNQkutKt_E8rZDYe=NKA@mail.gmail.com
Whole thread Raw
In response to Function to total reset a schema  (Surfing <onlinesurfing@gmail.com>)
List pgsql-sql
On Sun, May 29, 2011 at 1:38 AM, Surfing <onlinesurfing@gmail.com> wrote:
> Hi all,
> I need to write a function that totally empty a schema.
>
> So I have written a TRUNCATE statement for each table and set to 0 each
> sequence.
> Btw, it could be good to execute a vacuum statement on each table, but from
> within the function this is not allowed.

You shouldn't need to vacuum truncated tables, as they're basically at
a lower level just wiped out and replaced by a new empty file / table.Same goes for the indexes I believe.


pgsql-sql by date:

Previous
From: Surfing
Date:
Subject: Function to total reset a schema
Next
From: Thomas Kellerer
Date:
Subject: Re: Function to total reset a schema