Re: [GENERAL] Emptying a database.
От
Karl Auer
Тема
Re: [GENERAL] Emptying a database.
Дата
Msg-id
XFMail.981009082857.auer@kom.id.ethz.ch
Ответ на
Re: [GENERAL] Emptying a database. (Stuart Rison)
Список
Дерево обсуждения
Re: [GENERAL] Emptying a database. Stuart Rison <stuart@ludwig.ucl.ac.uk>
Re: [GENERAL] Emptying a database. Karl Auer <auer@kom.id.ethz.ch>
Re: [GENERAL] Emptying a database. Herouth Maoz <herouth@oumail.openu.ac.il>
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 по дате отправления