V
V
Valery2021-07-05 12:19:42
PostgreSQL
Valery, 2021-07-05 12:19:42

How to restore a PostgreSQL database?

I downloaded the database from this resource for training purposes: https://postgrespro.ru/docs/postgrespro/13/demodb-...
I'm trying to restore the database through pgAdmin 4. It gives an error. I do not know what to do. The database is necessary for the assimilation of the material.

Error:
60e2cea749888443160445.jpeg

Thank you for your attention!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-07-05
@galaxy

The pg_restore utility is designed to restore a Postgres Pro database from an archive created by the pg_dump command in any of the non-text formats

https://postgrespro.ru/docs/postgrespro/10/app-pgr...
You have a dump in SQL (text format).
There is no pgAdmin4 at hand (may Allah punish its creator), but somewhere there should be a button like "run SQL script", or "open SQL console" - you need to restore it from there.
Well, or run the console and in it the command that pgAdmin writes with replacing pg_restore.exe with psql.exe, and put <. About:
C:\Program Files\...\psql.exe --host ... --dbname "demo" < "C:\\Users\\...\\....SQL"

D
Dmitriy Loginov, 2021-07-05
@caramingo

It would not be bad to deal with the encoding in order to understand what is wrong with him.
Postgres user doesn't have a password?
Try to create an empty demo database first, and then restore the data from the downloaded dump into it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question