Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id EB7571E9AFB1 for ; Mon, 12 Dec 2011 07:32:27 -0400 (AST) Received: from mail-vx0-f174.google.com ([209.85.220.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ra47P-0000vf-Bf for pgsql-admin@postgresql.org; Mon, 12 Dec 2011 11:32:28 +0000 Received: by vcbfk14 with SMTP id fk14so3621851vcb.19 for ; Mon, 12 Dec 2011 03:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type:x-mailer :thread-index:content-language; bh=VQbxM0oI8Gtv7gJ55nUIwERyPFw1z2mtX8wYhfHIT7s=; b=QbkWRXiqBE9kZokcXqK0+VHF0NkpEsIUlHOd1kOVpb1NKxNaf9iYK6Gp8bagJbRttS YsCZeUZy3KWRcPMhA7zzTa4fBaKLglAeiSwEF9E/roTSV3ez9vsyyfzRaPcK6gD+A6Ev lRs+q7BFWdEFNgv2xxQh2iyJRSG/yRRdmIs4Q= Received: by 10.52.36.109 with SMTP id p13mr9476866vdj.59.1323689534828; Mon, 12 Dec 2011 03:32:14 -0800 (PST) Received: from PCJeanYves (inet-gw.alma.fr. [212.99.87.106]) by mx.google.com with ESMTPS id s10sm13919294vdj.1.2011.12.12.03.32.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 03:32:13 -0800 (PST) From: "Jean-Yves NOLEN" To: Subject: Problems while restoring databases Date: Mon, 12 Dec 2011 12:32:10 +0100 Message-ID: <00ff01ccb8c1$b19f2e60$14dd8b20$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0100_01CCB8CA.13654410" X-Mailer: Microsoft Outlook 14.0 Thread-Index: Acy4wa9FgEcOtQwTRZmC0sMUqdfFpQ== Content-Language: fr X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/63 X-Sequence-Number: 38821 This is a multipart message in MIME format. ------=_NextPart_000_0100_01CCB8CA.13654410 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0100_01CCB8CA.13654410 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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=3Dfoo ;  dst=3D 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 =3D = postgres

     =   ENCODING =3D 'UTF8'

     =   TABLESPACE =3D pg_default

     =   LC_COLLATE =3D 'French_France.1252'

     =   LC_CTYPE =3D 'French_France.1252'

     =   CONNECTION LIMIT =3D = -1;

<= p class=3DMsoNormal>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

------=_NextPart_000_0100_01CCB8CA.13654410--