From: | Karl Auer <auer(at)kom(dot)id(dot)ethz(dot)ch> |
---|---|
To: | Stuart Rison <stuart(at)ludwig(dot)ucl(dot)ac(dot)uk> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] Emptying a database. |
Date: | 1998-10-09 06:28:57 |
Message-ID: | XFMail.981009082857.auer@kom.id.ethz.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)kom(dot)id(dot)ethz(dot)ch) Geschaeft/work +41-1-6327531
Kommunikation, ETHZ RZ Privat/home +41-1-4517941
Clausiusstrasse 59 Fax +41-1-6321225
CH-8092 ZUERICH Switzerland
From | Date | Subject | |
---|---|---|---|
Next Message | Marc Eggenberger | 1998-10-09 08:23:57 | How to drop entries in a table? |
Previous Message | ArtFile Pte Ltd | 1998-10-09 02:47:30 | subscribe |