mkdir work cd work
mkdir [DB1] [DB2]
export DB=[DB1] for TBL in `psql -U postgres $DB -c '\dt' | awk 'NR > 3 { if ($3) { print $3 } }'`; do psql -U postgres $DB -c "\d $TBL" > $DB/$TBL.d; done
export DB=[DB2] for TBL in `psql -U postgres $DB -c '\dt' | awk 'NR > 3 { if ($3) { print $3 } }'`; do psql -U postgres $DB -c "\d $TBL" > $DB/$TBL.d; done
diff -rq [DB1] [DB2]
|