Reputation: 839
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?
Upvotes: 1
Views: 875
Reputation: 586
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
Upvotes: 1