Newbie to postgresql, I come from an Windows background with Backup Exec and Veritas GUI driven applications, I also have a Centos bacula background.

If this is in the wrong forum, please move.

I have a Windows Server with a postgreSQL database and looking into how to back it up and restore it with Windows command line or pgAdmin III.

I have used the pg_dump dbname > output file, and restore with psql dbname < infile. I have seen the post with pg_dump does not include tablespaces, groups or users and pg_dump only dumps one of my databases in a cluster / instance.

I also use the pgAdmin III backup and restore

My questions are:

With the pg_dump are there better commands switches to backup individual databases or the whole sql file / all databases?

Can you schedule the pgAdmin III for nightly backups?



  • For sql backup Iam not an expert, but usually you have a export/commit to do, so it truncate the transaction log and it make a file recoverable. Over that I usually do another kind of backup, wbadmin or the one you need – yagmoth555 Oct 28 '16 at 0:34
  • So if I have 3 databases in PostgreSQL a .bat file would be: net stop postgresql-9.4 pg_dump dbname > outputfile net start postgresql-9.4 – Tech.Kid1961 Oct 28 '16 at 0:36

If you are looking for a way to backup PostgreSQL databases automatically according to the schedule then you can try PostgreSQL-Backup https://postgresql-backup.com it performs backups via pg_dump tool. Such backups can be easily restored via command prompt:

  1. Go to Postgres bin folder. For example: cd "C:\ProgramFiles\PostgreSQL\9.5\bin"

  2. Enter the command to restore your database. For example: psql.exe -U -d -f

  3. Type password for your postgres user

  4. Check the restore process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.