In this video I have shown how to take back up of PostgreSQL database in windows PC using Command Prompt.
This is demonstrated in windows 10 pc.
1. Open the command prompt in Administrator mode.
Below shown the commands to back up a database. Please update with the details with your credentials.
1 2 |
set PGPASSWORD=<pgpassword> pg_dump -h "<hostname>" -U "<username>" -f "<backuppath with filename>" "<database>" |
Below shown the commands shown in the video with my credentials and db name.
1 2 |
set PGPASSWORD=root pg_dump -h "localhost" -U "postgres" -f "E:\\autobc\\hr_backup" "HR_DATA" |
2. Once you have executed the above commands, It will take back of database HR_DATA in the location E:\autobc as given in the command.
The screenshots are shown below.