Re: How to remove the current database and populate the database with new data?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: "Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>
Subject: Re: How to remove the current database and populate the database with new data?
Date: 2010-06-03 23:09:53
Message-ID: 201006031609.53404.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 03 June 2010 4:05:14 pm Wang, Mary Y wrote:
> Hi,
>
> I've some test data in a database and would like to delete that database
> and clean everything that is associated with that database. Then I'd like
> to populate the same database with different data. My plan is to:
> (1) Remove the /usr/local/pgsql/data directory
> (2) psql -e mydatabase -f /tmp/indumpfile.txt & > /tmp/outdumpfile.txt
> (/tmp/indumpfile.txt has all the sql statements to restore the database)
> (3) Restart the postgres server
>
> Not sure if I need to run the VACCUM command, because I know Postgres 8.3.8
> has the auto-vacuum daemon on to perform VACCUMs when it's necessary. Did
> I miss any other steps for cleaning up?
>
> Please advise.
>
> Thanks
> Mary

Why not use DROP DATABASE? Removing the data directory removes the whole
Postgres cluster, possibly including the config files.

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wang, Mary Y 2010-06-03 23:26:05 Re: How to remove the current database and populate the database with new data?
Previous Message Joshua D. Drake 2010-06-03 23:09:25 Re: How to remove the current database and populate the database with new data?