Re: [GENERAL] Emptying a database.

From: Jeremiah Davis <jdavis(at)gaslightmedia(dot)com>
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-08 15:08:34
Message-ID: Pine.3.89.9810081129.A6125-0100000@onramp.freeway.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

you just want to dump all the data? just use delete then..

DELETE FROM tablename;

Deletes all the data in the table....

On Thu, 8 Oct 1998, Stuart Rison wrote:

> Dear All,
>
> I'm currently doing some database design work and find myself entering
> loads of test records into my database tables.
>
> Occasionally I want to 'flush' out the database (i.e. keep all tables,
> views, etc. but delete all records). Currently I have to pg_dump the
> database and then use a text editor to cut out all the 'copy' statements
> out and recreate a 'new' database.
>
> Is there a way of flushing the content of all tables?
>
> Thanks for any help you may provide.
>
> Cheers,
>
> Stuart.
>
>
> +-------------------------+--------------------------------------+
> | Stuart Rison | Ludwig Institute for Cancer Research |
> +-------------------------+ 91 Riding House Street |
> | Tel. (0171) 878 4041 | London, W1P 8BT, UNITED KINGDOM. |
> | Fax. (0171) 878 4040 | stuart(at)ludwig(dot)ucl(dot)ac(dot)uk |
> +-------------------------+--------------------------------------+
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stuart Rison 1998-10-08 15:37:51 Re: [GENERAL] Emptying a database.
Previous Message Stuart Rison 1998-10-08 15:01:12 [GENERAL] Emptying a database.