Postgres backup & restore

From: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>
To: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Postgres backup & restore
Date: 2019-04-16 17:41:31
Message-ID: BL0PR01MB5187FF87AD89EC1CC7D673449B240@BL0PR01MB5187.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello team,

We have a postgres11.2 on docker and we are migrating a kb_rep database from postgres 9.6 to postgres 11.2 via pg_dump/pg_restore
We have created a kb_rep schema in postgres 11.2 also but during pg_restore there is an error "pg_restore: [archiver (db)] connection to database "kb_rep" failed: FATAL: database "kb_rep" does not exist"

See below:

psql (11.2 (Ubuntu 11.2-1.pgdg18.04+1))
Type "help" for help.

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+---------+---------+-----------------------
kb_rep | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
kbdb | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)

postgres=#

postgres(at)b06a42b503e9:/$ pg_restore -h 10.29.50.21 -p 5432 -d kb_rep -v /var/lib/kb_rep_backup16
pg_restore: connecting to database for restore
Password:
pg_restore: [archiver (db)] connection to database "kb_rep" failed: FATAL: database "kb_rep" does not exist
postgres(at)b06a42b503e9:/$

Please help on this issue.

Regards,
Daulat

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2019-04-16 17:54:03 Re: Postgres backup & restore
Previous Message Tom Lane 2019-04-16 15:30:19 Re: Out of Memory errors are frustrating as heck!