Re: [GENERAL] Emptying a database. - Mailing list pgsql-general

From Karl Auer
Subject Re: [GENERAL] Emptying a database.
Date
Msg-id XFMail.981009082857.auer@kom.id.ethz.ch
Whole thread Raw
In response to Re: [GENERAL] Emptying a database.  (Stuart Rison <stuart@ludwig.ucl.ac.uk>)
Responses Re: [GENERAL] Emptying a database.
List pgsql-general
Hi there.

Am 08-Oct-98 schrieb Stuart Rison:
>>you just want to dump all the data?  just use delete then..
>>
>>DELETE FROM tablename;
>>
>>Deletes all the data in the table....
>>
>
> Yes (thanks ;) ), but I want to do so for ALL my tables within a db without
> having to type in the command for each table (I mean currently I have 20
> tables but I'm likely to have more).
>
> The way around it I've thought of is to write a delete for each table in a
> file and then just run them with \i.

Or duplicate the database, delete everything from the duplicate (only need to
do this once, or whenever you add/delete tables from your design), and simply
copy the duplicate over the original whenever you want to clear it.

Regards, K.

---
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (auer@kom.id.ethz.ch)              Geschaeft/work     +41-1-6327531
Kommunikation, ETHZ RZ                          Privat/home     +41-1-4517941
Clausiusstrasse 59                                      Fax     +41-1-6321225
CH-8092 ZUERICH Switzerland

pgsql-general by date:

Previous
From: ArtFile Pte Ltd
Date:
Subject: subscribe
Next
From: Marc Eggenberger
Date:
Subject: How to drop entries in a table?