pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problems while restoring databases
2+ messages / 2 participants
[nested] [flat]

* Problems while restoring databases
@ 2011-12-12 11:32 Jean-Yves NOLEN <jynolen@gmail.com>
  2011-12-12 16:11 ` Re: Problems while restoring databases Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Jean-Yves NOLEN @ 2011-12-12 11:32 UTC (permalink / raw)
  To: 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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problems while restoring databases
  2011-12-12 11:32 Problems while restoring databases Jean-Yves NOLEN <jynolen@gmail.com>
@ 2011-12-12 16:11 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-12-12 16:11 UTC (permalink / raw)
  To: Jean-Yves NOLEN <jynolen@gmail.com>; +Cc: pgsql-admin

"Jean-Yves NOLEN" <jynolen@gmail.com> writes:
> [ while restoring a pg_dump backup ]
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 626; 2612 16386 PROCEDURAL
> LANGUAGE plpgsql postgres
> pg_restore: [archiver (db)] could not execute query: ERREUR:  language
> "plpgsql" already exists

Probably the reason you get this is that you have plpgsql installed in
template1, and so it's already there in your destination database.
You can avoid that by cloning the new database from template0
(add "TEMPLATE template0" to your CREATE DATABASE command).

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-12-12 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12 11:32 Problems while restoring databases Jean-Yves NOLEN <jynolen@gmail.com>
2011-12-12 16:11 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox