I have PostgreSQL server version 9.5. Contains 20 Databases.

I want take server backup skipping of some 10 databases.

Am using pg_dumpall, but it was taking full server backup.


1 Answer 1


Instead of using pg_dumpall, just use pg_dump and specify which databases you want to dump. One possible way to do it is:

for db in <space-separated list of database names>
  pg_dump -U <user> -h <host> ${db} > ${db}.dmp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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