list all the database from the postgresql server,
run the query in postgresql
psql SELECT datname FROM pg_database;
it will list all the database from the postgres server. copy and paste it in one text file. and run the script.
import os
lines = [line.strip() for line in open('<<path to file>>')]
for i in lines:
print os.system("pg_dump %s > <<path to file>>%s.out" % (i,i))
smart way to get backup your database..!
ReplyDeletecool!!!