Re: EMPTYING A DATABASE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: EMPTYING A DATABASE
Date: 2010-04-29 18:56:35
Message-ID: 17153.1272567395@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"George Weaver" <gweaver(at)shaw(dot)ca> writes:
> From: "Tom Lane":
> My thought would be to make use of multi-table TRUNCATE, assuming
> he's using a PG version new enough to have that. Keep a script
> around with a TRUNCATE that lists all of the related tables in one
> command, and just run the script to reset.

> Wouldn't using pg_dump with the schema only option accomplish this?

Sure. I assume the OP already thought of that, and was curious
about alternatives. (One possible reason to prefer the TRUNCATE
approach though: you don't necessarily have to zap *every* table
in the database.)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tony Day 2010-04-30 01:59:55 Long (really long) queries and not sure how to diagnose
Previous Message George Weaver 2010-04-29 18:21:06 Re: EMPTYING A DATABASE