I have been tasked with creating pg_dump files for a db on which there are over 50 tables. I know how to do this manually via the psql command line, but I believe there must be a faster way than doing each one by hand. Any suggestions on how to it programmatically? For example, can a perl script call pg_dump?
Share
If I understand your question correctly, then following Bash script should be sufficient:
It gets list of all tables within some database and execute
pg_dump -tfor each of them.Here is Perl equivalent if you prefer: