Problems while restoring databases

From: "Jean-Yves NOLEN" <jynolen(at)gmail(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Problems while restoring databases
Date: 2011-12-12 11:32:10
Message-ID: 00ff01ccb8c1$b19f2e60$14dd8b20$@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi everyone !

I am facing a problem after a lot of research has not found a solution.
I hope some of you can enlighten me
I will hold my position in 3 part: what I want, what I run, which is a
problem.

First of all I want to:

Back up a database with all information (structure, data, functions,
triggers) in a "dump"
Restore the same data (structure, data, trigger, etc ...) into a new
database with a different name (ex: src=foo ; dst= bar)

So far not rocket science.

Then what I do:
pg_dump -i -F c -i -h ***.***.***.*** -p #### -U #### -f c:\dump.bak
mySourceBase

A creation of new base like this :

CREATE DATABASE "testingBackup"

WITH OWNER = postgres

ENCODING = 'UTF8'

TABLESPACE = pg_default

LC_COLLATE = 'French_France.1252'

LC_CTYPE = 'French_France.1252'

CONNECTION LIMIT = -1;

And finally :

pg_restore -F c -h ##### -p #### -U #### -d testingBackup C:\dump.bak

What problems i got

pg_restore: [archiver (db)] Error while PROCESSING TOC:

pg_restore: [archiver (db)] Error from TOC entry 626; 2612 16386 PROCEDURAL
LANG

UAGE plpgsql postgres

pg_restore: [archiver (db)] could not execute query: ERREUR: language
"plpgsql" already exists

Command was:

CREATE PROCEDURAL LANGUAGE plpgsql;

WARNING: errors ignored on restore: 1

In fact there is no problem since all data is restored but in a goal of
"cleanliness" I want to clean this mess and finally get no error.
To this end I am open to your suggestions.

Thank you in advance for your help, and I apologies for my bad English.

Jean-Yves

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2011-12-12 16:11:19 Re: Problems while restoring databases
Previous Message Jasen Betts 2011-12-10 09:00:26 Re: How could I find the last modified procedure in the database?