Re: Backup & Restore

From: Ilan Volow <listboy(at)clarux(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Backup & Restore
Date: 2006-09-27 13:13:21
Message-ID: 2A141EC3-2C17-4213-BFAE-11A970283E36@clarux.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

My usual way of getting around this problem involves doing a pg_dump
of the database, deleting the database, re-creating the database, and
then repopulating it. For example, if there was a database named
bunny, I'd do the following:

dropdb bunny
createdb bunny
psql bunny < bunny_backup_dump

--Ilan

On Sep 27, 2006, at 8:13 AM, Felipe Giotto wrote:

> Hi!
>
> I know this is a extremely novice question :D, but I'm trying to
> use a simple command to backup an entire database to a file, and
> then restore the entire database from the file, overwriting all the
> previously data stored on the old database. I tried pg_dump and
> pg_restore (i can't remember the parameters right now), but
> pg_restore always returns an error about primary key violations.
> Can anybody tell me two commands to backup and restore my databases
> without these key violation problems?
>
> Thanks for the help!
>
> Felipe Giotto ;-)
>
>
> PS: Sorry for my poor english!! :D
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-09-27 13:32:33 Re: pass date type data to PQexecparams
Previous Message A. Kretschmer 2006-09-27 12:57:05 Re: Backup & Restore