X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 96B038BA1E0 for ; Tue, 15 Feb 2005 17:24:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84586-06 for ; Tue, 15 Feb 2005 17:24:45 +0000 (GMT) Received: from ecintweb.eldocomp.com (smtp.eldocomp.com [205.159.99.8]) by svr1.postgresql.org (Postfix) with ESMTP id F36768B9E19 for ; Tue, 15 Feb 2005 17:24:43 +0000 (GMT) Received: by ecintweb.eldocomp.com with XWall v3.31 ; Tue, 15 Feb 2005 10:24:41 -0700 From: Naomi Walker To: Dick Davies Cc: PostgreSQL Admin Subject: Re: empty a database Date: Tue, 15 Feb 2005 10:24:41 -0700 X-Assembled-By: XWall v3.31 Message-ID: <42123059.2070505@eldocomp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/125 X-Sequence-Number: 16293 How about just truncating all the tables? Dick Davies wrote: > * Tom Lane [0232 16:32]: >=20 >>Dick Davies writes: >> >>>Is there a neat way to clean out a database via SQL commands? >>>i.e. get rid of tables, sequences, integers, etc. >> >>>At present I'm using dropdb/createdb, but thats' far from ideal >>>and I think it's causing postgres to do more mork than it needs to... >> >>Well, if you put everything into one or a few schemas then dropping >>and recreating those schemas would do it. I suspect though that this >>is *not* faster than dropdb/createdb. >=20 >=20 > Thanks Tom. >=20 > It's not just the speed, it's the constant deletes and creations in > ~pgsql/data - as I said the other day, this is recreating a test db from t= he > production one as part of unit tests, so this happens dozens of times a da= y... >=20 >=20 --=20 ------------------------------------------------------------------------- Naomi Walker Chief Information Officer Eldorado Computing, Inc. nwalker@eldocomp.com 602-604-3100 ------------------------------------------------------------------------- Courage is the power to let go the familiar. -Raymond Lindquist ------------------------------------------------------------------------- -- CONFIDENTIALITY NOTICE -- This message is intended for the sole use of the individual and entity to wh= om it is addressed, and may contain information that is privileged, confiden= tial and exempt from disclosure under applicable law. If you are not the int= ended addressee, nor authorized to receive for the intended addressee, you a= re hereby notified that you may not use, copy, disclose or distribute to any= one the message or any information contained in the message. If you have rec= eived this message in error, please immediately advise the sender by reply e= mail, and delete the message. Thank you.