I've had the best success of using a cron job to commit any changes to a source control system like git or subversion on a daily basis.
--create a SQL file per schema
for i in $(psql -t -A -c "select nspname from pg_namespace where nspname not like 'pg_%' and nspname not like '%toolkit' and nspname not in ('information_schema', 'madlib', 'public') order by nspname;"); do
pg_dump -s -n $i -f $i.sql
for i in $(ls *.sql); do
#your code to commit the changes to source control like git
Asked in February 2016Viewed 3,480 timesVoted 4Answered 1 times