Thread: Pg_restore
Hello,
we are trying to move our postgres 10.5 instance to 11.2
We are trying to restore a DB in a pre-production env but we get an error on the pg_restore command
[root@STAGING]# /usr/local/pgsql11.2/bin/pg_restore -v -U postgres -L /data/cofinder_restore.lst -d cofinder -j 16 /home/ncontu/data/dbbackups/C
pg_restore: connecting to database for restore
pg_restore: processing item 3098 ENCODING ENCODING
pg_restore: processing item 3099 STDSTRINGS STDSTRINGS
pg_restore: processing item 3100 SEARCHPATH SEARCHPATH
pg_restore: processing item 3101 DATABASE cofinder
pg_restore: processing item 3 SCHEMA public
pg_restore: creating SCHEMA "public"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA public postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists
Command was: CREATE SCHEMA public;
The dump is taken with pgsql10 binaries.
Can you help on this please?
We also have another DB, but with the other one no issues doing the same thing.
Thanks
On 3/1/19 2:17 AM, Nicola Contu wrote: > Hello, > we are trying to move our postgres 10.5 instance to 11.2 > > We are trying to restore a DB in a pre-production env but we get an error > on the pg_restore command > > [root@STAGING]# /usr/local/pgsql11.2/bin/pg_restore -v -U postgres -L > /data/cofinder_restore.lst -d cofinder -j 16 /home/ncontu/data/dbbackups/C > pg_restore: connecting to database for restore > pg_restore: processing item 3098 ENCODING ENCODING > pg_restore: processing item 3099 STDSTRINGS STDSTRINGS > pg_restore: processing item 3100 SEARCHPATH SEARCHPATH > pg_restore: processing item 3101 DATABASE cofinder > pg_restore: processing item 3 SCHEMA public > pg_restore: creating SCHEMA "public" > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA > public postgres > pg_restore: [archiver (db)] could not execute query: ERROR: schema > "public" already exists > Command was: CREATE SCHEMA public; > > The dump is taken with pgsql10 binaries. > > Can you help on this please? > We also have another DB, but with the other one no issues doing the same > thing. Out of curiosity, why are you using the "-L" option instead of restoring the whole database? -- Angular momentum makes the world go 'round.
I guess it depends on this https://www.postgresql.org/message-id/15466-0b90383ff69c6e4b%40postgresql.org
Thanks
Il giorno ven 1 mar 2019 alle ore 09:17 Nicola Contu <nicola.contu@gmail.com> ha scritto:
Hello,we are trying to move our postgres 10.5 instance to 11.2We are trying to restore a DB in a pre-production env but we get an error on the pg_restore command[root@STAGING]# /usr/local/pgsql11.2/bin/pg_restore -v -U postgres -L /data/cofinder_restore.lst -d cofinder -j 16 /home/ncontu/data/dbbackups/Cpg_restore: connecting to database for restorepg_restore: processing item 3098 ENCODING ENCODINGpg_restore: processing item 3099 STDSTRINGS STDSTRINGSpg_restore: processing item 3100 SEARCHPATH SEARCHPATHpg_restore: processing item 3101 DATABASE cofinderpg_restore: processing item 3 SCHEMA publicpg_restore: creating SCHEMA "public"pg_restore: [archiver (db)] Error while PROCESSING TOC:pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA public postgrespg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already existsCommand was: CREATE SCHEMA public;The dump is taken with pgsql10 binaries.Can you help on this please?We also have another DB, but with the other one no issues doing the same thing.Thanks