[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Database updates



Ok, two pieces of quick feedback.

First right now I would highly recommend that if you have to follow
schema changes you join the ledger-smb-commits list on sourceforge.
That will help a lot right there.

Secondly, a tool to compare schemas will be helpful, and I would like
to create one in the near future.  in the mean time, as a simple
discussion draft, let me post the following bash code.

rm ../testdump1.sql ../testdump2.sql
for line in `grep -i "^create table" sql/Pg-database.sql | sed -e
's/(.*$//' | awk '{ print $3 }'`
    do pg_dump -U postgres -s -t $line database1 | grep -v GRANT |
grep -v REVOKE >> ../testdump1.sql
done

for line in `grep -i "^create table" sql/Pg-database.sql | sed -e
's/(.*$//' | awk '{ print $3 }'`
    do pg_dump -U postgres -s -t $line database2 | grep -v GRANT |
grep -v REVOKE >> ../testdump2.sql
done

diff ../testdump1.sql ../testdump2.sql

If this sort of result is found to be acceptable, I could probably
port the first two parts to Perl pretty easily.  Not sure about diffs
though.

Best Wishes,
Chris Travers