PostgreSQL Tutorial 7 -- Taking DB Backup and Restoring the DB Backup in postgresql

Below is the process to create Normal DB Backup in postgresql.






Below is the process to create DB Backup (.SQL file) in postgresql.





Below is the process to create TAR Backup in postgresql.




Below is the process to Compressed DB Backup in postgresql.




Below is the process to Restore DB Backup in postgresql.





When we we try to restore we got the error "pg_restore: error: could not execute query: error: schema "public" already exists". We fixed the issue with the command. 

pg_restore -h localhost --schema=public -d ios5 -U postgres -Ft "C:\Users\dDriv\Downloads\Shiftlog221.tar"



Below is the process to Restore TAR DB Backup in postgresql.


1. Creating the DB for Restore


2. Restoring the TAR DB Backup with PG_Restore utility. 






Below is the process to Restore Compressed DB Backup in postgresql.


1. Creating the DB for Restore



2. Restoring the Compressed DB Backup with PG_Restore utility.



Please note that, the tar and compressed backup sizes in above. Compressed backup size is 9 MB and Tar backup is 150 MB. 

Comments

Popular posts from this blog

How to connect postgresql database through ODBC driver in excel

Postgresql System files and their uses