From: Stef <svb@ucs.co.za>
To: John DeSoi <desoi@pgedit.com>
Cc: pgsql-ADMIN@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SOLVED] Postgres schema comparison.
Date: Mon, 7 Mar 2005 18:08:37 +0200
Message-ID: <20050307180837.44cd681f@svb.ucs.co.za> (raw)
In-Reply-To: <1098CCF1-8F1E-11D9-A12B-000A95B03262@pgedit.com>
References: <20050307113312.2200b65c@svb.ucs.co.za>
<F393FF18-8F05-11D9-A12B-000A95B03262@pgedit.com>
<20050307170914.51376f05@svb.ucs.co.za>
<1098CCF1-8F1E-11D9-A12B-000A95B03262@pgedit.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: svb@ucs.co.za, desoi@pgedit.com, pgsql-ADMIN@postgresql.org
Subject: Re: [SOLVED] Postgres schema comparison.
In-Reply-To: <20050307180837.44cd681f@svb.ucs.co.za>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox