1

I need to restore the PostgreSQL .backup file while running PostgreSQL docker image. I am able to restore the database with .sql file but it is taking too much time because the file size is more than 100mb and it will fire 500000 insert statement. Is there any other way to restore database much faster inside docker container?

1 Answer 1

1

First, pg_dump/pg_restore can use copy which is much faster than the insert option look at the archive option.

If backup/restore take too long then you can use file system backups. It would allow for incremental backups which are (if frequent enough) faster to restore.

That being said, 100mb is rather small and you should be able to recover quickly with the copy option.

Btw, if you're looking for a docker based solution, you could commit the container (or data container if you use it) and then restore by simply pulling the new image.

Regards Jony

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.