#! /usr/bin/env bash dir="$(mktemp -d)" docker_container="uqac-websem-postgresql" docker_db="websem" docker_user="websem" local_db="websem_project" local_user="dev" local_pwd="dev" pg_dump_options="-s -x --no-owner --inserts" if [ -t 1 ] then echo "Working dir: ${dir}" fi cd "${dir}" && docker exec -i "${docker_container}" pg_dump "${docker_db}" -U "${docker_user}" ${pg_dump_options} > docker && PGPASSWORD="${local_pwd}" pg_dump "${local_db}" -U "${local_user}" -h 127.0.0.1 ${pg_dump_options} > local && apgdiff docker local