0

I'm new with docker and i have to learn at my new job, so i should restore a sql file into a postgres container, when i type the command:

docker exec -i postgres-container pg_restore -U postgres -d postgres /var/lib/postgresql/data/_postgres_2020-11-09T02_00_06Z.sql

i get the following message:

pg_restore: error: input file appears to be a text format dump. Please use psql.

After that i tried to convert that file with psql inside the container but i get this message:

psql: error: FATAL:  role "root" does not exist.

How can i get this? can someone help me ?

Doj
  • 1,244
  • 6
  • 13
  • 19
joselito
  • 37
  • 6

1 Answers1

0

I got it! activereality's answer solve my problem in this post Backup/Restore a dockerized PostgreSQL database

cat your_dump.sql | docker exec -i your-db-container psql -U postgres -d dbname

joselito
  • 37
  • 6