X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BA9EF5654E; Mon, 7 Mar 2005 16:08:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12551-03; Mon, 7 Mar 2005 16:08:51 +0000 (GMT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id B43F856545; Mon, 7 Mar 2005 16:08:47 +0000 (GMT) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id D62092BD4D; Mon, 7 Mar 2005 18:08:36 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id 5B6B1D9F3D; Mon, 7 Mar 2005 18:08:36 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with ESMTP id 3B598973EC; Mon, 7 Mar 2005 18:08:38 +0200 (SAST) Date: Mon, 7 Mar 2005 18:08:37 +0200 From: Stef To: John DeSoi Cc: pgsql-ADMIN@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SOLVED] Postgres schema comparison. Message-ID: <20050307180837.44cd681f@svb.ucs.co.za> In-Reply-To: <1098CCF1-8F1E-11D9-A12B-000A95B03262@pgedit.com> References: <20050307113312.2200b65c@svb.ucs.co.za> <20050307170914.51376f05@svb.ucs.co.za> <1098CCF1-8F1E-11D9-A12B-000A95B03262@pgedit.com> X-Mailer: Sylpheed-Claws 1.0.1 (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: +lU/o'$=Zv9%Xjo]Kq[_{n&Kb`f{YEWH4&Y#M]'6BkD?VoWe#*@S\MWyD'I>s:0v4{#\[J]l*?]t2uaO(j$d*77Ca-UHo.tkl2)0$B3Jxww\o:xor]<:*Yfx9Vceh)9I/'2g\RKhGTxIIsR^ke^`LVeZ9ksb*:$kQeR@ X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.328 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_WHOIS X-Spam-Level: X-Archive-Number: 200503/92 X-Sequence-Number: 16590 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