Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id CD6BEB5DC3C for ; Sat, 28 May 2011 11:16:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88868-07 for ; Sat, 28 May 2011 14:16:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 32CCAB5DC39 for ; Sat, 28 May 2011 11:16:05 -0300 (ADT) Received: by wya21 with SMTP id 21so1808725wya.19 for ; Sat, 28 May 2011 07:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=YcpqorhlgBU3wySHSHUsIlolvRNdtgPICJgL+NXmbAs=; b=kDATamIvpXaWnni2OLNvT9L/SD+OvsD2leQT7u5Ofo7MsddQBP/DMecBq5UZCWnB+a pgvB+PDbuBWm0NM7LBJaMqzVFkcArgMcSKfAvNxBBpexRQLK5AhR289MgyzcQ4appAWn LEWsMMCKNyUBmYtqhZ0hw4t6UmuAFC6U8T93Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=KlRTwKboEv9sZSEiXh3dfFvQkdfL00zJuI9F4RQ78tEu3Kvpow95pXj4wDYrfCoOGy CxwVYqu1ux33haNjOP2P5Zag/EPgF93F2lO7k6BkXjbZ0az9QEaAeeEHTRMACjTDyhdr ytyXOPpnvgF3HgqtyuRiHjMvYaHcEM9+MDI7A= Received: by 10.227.197.83 with SMTP id ej19mr3069478wbb.105.1306592166102; Sat, 28 May 2011 07:16:06 -0700 (PDT) Received: from [192.168.1.100] ([188.11.27.109]) by mx.google.com with ESMTPS id ex2sm1864581wbb.31.2011.05.28.07.16.04 (version=SSLv3 cipher=OTHER); Sat, 28 May 2011 07:16:05 -0700 (PDT) Message-ID: <4DE103A5.9030900@gmail.com> Date: Sat, 28 May 2011 16:16:05 +0200 From: Surfing User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Function to total reset a schema Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/179 X-Sequence-Number: 35463 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. Is there a way to obtain the same result in another way (without using the vacuum)? Thanks