Reputation: 1
I need some help with a Postgres backup. I am trying to restore a database backup from the pgAdmin III 1.16.1 from Windows 7 x32. The original database is in one server (also w7) and the other one is on a Ububtu Server. I have tried every combination of options available, I even tried to do the backup and restore from de commandline of the server and from windows instead of using the graphic interphase.
theese are the commands executed and the errors. The result is that the database is restored, but only a portion.
please help me!
I copied only a part of the log, because it´s too long....but no error seams to be "the one"
C:\Program Files\pgAdmin III\1.10\pg_dump.exe --host 00.00.0.000
--port 0000 --username "username" --role "role" --no-password
--format tar --blobs --encoding UTF8 --verbose --file
"C:\Users\xxxxx\Documents\BackUpPostgres\backU.backup" "DATABASE"
C:\Program Files\pgAdmin III\1.10\pg_restore.exe --host 111.111.11.111
--port 0000 --username "username" --dbname "database"
--role "role" --no-password --verbose
"C:\Users\xxxxx\Documents\BackUpPostgres\backU.backup"
pg_restore: connecting to database for restore
pg_restore: creating COMMENT database
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1774; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists
Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
pg_restore: creating SHELL TYPE box2d
pg_restore: [archiver (db)] Error from TOC entry 1673; 0 0 SHELL TYPE box2d postgres
pg_restore: [archiver (db)] could not execute query: ERROR: type "box2d" already exists
Command was: CREATE TYPE box2d;
pg_restore: creating FUNCTION st_box2d_in(cstring)
pg_restore: [archiver (db)] Error from TOC entry 936; 1255 18058 FUNCTION st_box2d_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not access file "$libdir/postgis-1.4": No such file or directory
Command was: CREATE FUNCTION st_box2d_in(cstring) RETURNS box2d
LANGUAGE c IMMUTABLE STRICT
AS '$libdir/postgis-1.4', 'BOX2DFLOAT...
pg_restore: [archiver (db)] could not execute query: ERROR: function public.st_box2d_in(cstring) does not exist
Command was: ALTER FUNCTION public.st_box2d_in(cstring) OWNER TO postgres;
Upvotes: 0
Views: 3739
Reputation: 32378
You should dump the data without the public
schema, it could be done with the --exclude-schema
switch (or shortcut is -N
).
pg_dump -U my_user -d my_database -N public -F c backup.dump
Upvotes: 1