Re: restoring with pg_restore

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: restoring with pg_restore
Date: 2008-04-24 13:00:21
Message-ID: 48108465.90207@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Didier Gasser-Morlay wrote:
> - I believe that restoring a backup onto an existing, non empty
> database generates 'primary key violations' and I am not sure about
> what happens to exsiting records, I do not believe they are updated so
> I can get a restored database with data inconsistent with the 'live'
> server

Correct; existing rows within tables will not be updated.

> so, as I understand it, I would on the report server need to drop the
> database ; create a new bank database and restore onto this new
> database.
>
> If I am correct so far, my question is : is it a good practice to drop
> and create a database every day on a postgreSQL server or do I risk
> any corruption of the database cluster (that's how I call the
> directory and files created with initdb)

Go ahead. Simply use -c option of pg_dump/pg_dumpall.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2008-04-24 15:39:40 Re: Changing a trigger function
Previous Message A. Kretschmer 2008-04-24 09:28:03 Re: Limiting the number of connections for one user