Re: restoring with pg_restore - Mailing list pgsql-novice

From Frank Bax
Subject Re: restoring with pg_restore
Date
Msg-id 48108465.90207@sympatico.ca
Whole thread Raw
In response to Re: restoring with pg_restore  ("Didier Gasser-Morlay" <didiergm@gmail.com>)
List 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.

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Limiting the number of connections for one user
Next
From: Tom Lane
Date:
Subject: Re: Changing a trigger function