Re: Postgres back up error

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Azimuddin Mohammed <azimeiu(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgres back up error
Date: 2018-04-26 18:44:59
Message-ID: CAKFQuwa6+w5O_TskjA1SrSeVXOzD=1kGzDexcs-rTmTEy-H+Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thursday, April 26, 2018, Azimuddin Mohammed <azimeiu(at)gmail(dot)com> wrote:

> Hello All,
>
> I am trying to implement postgres database backup and restore on existing
> database. I am using the pg_dump utility to back up the database pg_dump -U
> postgres testdb -f testdb.sql
>
> My backup is successfully generated with the latest data in it BUT when I
> restore this file using the command “psql -U postgres db.sql testdb -f in
> another standby server I am getting this below error. I understand that its
> stopping me because the database already exist with table column as
> primary key column. How can I over write this I need to restore my database
> nightly on my standby server.
>

Basically dump/restore requires the target to be empty and the entire dump
is restored into it. Somewhere in your proces you need to send an
instruction to the "standby" server to "drop database" if you wish to use
dump/restore. If you'd like incremental backup you will want to use a
different toolset.

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message ml 2018-04-26 21:45:48 pgadmin4 python bug?
Previous Message Azimuddin Mohammed 2018-04-26 18:34:03 Postgres back up error