Re: EMPTYING A DATABASE - Mailing list pgsql-novice

From Tom Lane
Subject Re: EMPTYING A DATABASE
Date
Msg-id 17153.1272567395@sss.pgh.pa.us
Whole thread Raw
In response to Re: EMPTYING A DATABASE  ("George Weaver" <gweaver@shaw.ca>)
List pgsql-novice
"George Weaver" <gweaver@shaw.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

pgsql-novice by date:

Previous
From: "George Weaver"
Date:
Subject: Re: EMPTYING A DATABASE
Next
From: Tony Day
Date:
Subject: Long (really long) queries and not sure how to diagnose