Re: [SOLVED] Postgres schema comparison. - Mailing list pgsql-admin

From Stef
Subject Re: [SOLVED] Postgres schema comparison.
Date
Msg-id 20050307180837.44cd681f@svb.ucs.co.za
Whole thread Raw
In response to Re: Postgres schema comparison.  (John DeSoi <desoi@pgedit.com>)
Responses Re: [SQL] [SOLVED] Postgres schema comparison.
List pgsql-admin
John DeSoi mentioned :
=> I'm not sure you can use \d directly, but if you startup psql with the
=> -E option it will show you all the SQL it is using to run the \d
=> command. It should be fairly easy to get the strings you need from the
=> results of running a similar query. The psql source is a good place to
=> look also.

Sometimes you just need to see things from a different perspective.
Thanks!

Here's my final solution that runs in less than a minute for +- 543 tables :
for x in $(psql -tc "select relname from pg_class where relkind = 'r' and relname not like 'pg_%'")
do
   echo "$(psql -tc "select  encode(digest('$(psql -c  '\d '${x}'' mer9188_test | tr -d \"\'\")', 'md5'), 'hex')"
mer9188_test| grep -v "^$"|tr -d " "):${x}" 
done > compare_list.lst

pgsql-admin by date:

Previous
From: Stef
Date:
Subject: Re: [SQL] Postgres schema comparison.
Next
From: Michael Fuhr
Date:
Subject: Re: Backup procedure