I have taken full backup of postgresql database which consists of 100 databases. The backup format is .sql (eg pg_dumpall.exe -U postgres > D:\Backup\fullbkp.sql) now one of my database got crashed and I want to extract this file to get that database backup only for restoration. I have searched a lot but couldn't find any way to decompress so that I can get that particular database from full backup file. Please suggest !!!! Regards Sadam
1 Answer 1
Such a backup is not compressed. Also, it contains a backup of all databases in th cluster, and there is no easy way to extract a single database.
Create a new PostgreSQL cluster with initdb, restore the dump there using psql, then use pg_dump to extract the single database you need.
6 Comments
-F p) and pipe it through gzip. But I recommend that you take a "custom format" dump (-F c), which is automatically compressed and can be restored with pg_restore. The only down side is that you can only dump individual databases that way; there is no custom format for pg_dumpall.Explore related questions
See similar questions with these tags.