Re: [SOLVED] Postgres schema comparison.
От | Stef |
---|---|
Тема | Re: [SOLVED] Postgres schema comparison. |
Дата | |
Msg-id | 20050307180837.44cd681f@svb.ucs.co.za обсуждение исходный текст |
Ответ на | Re: Postgres schema comparison. (John DeSoi <desoi@pgedit.com>) |
Ответы |
Re: [SQL] [SOLVED] Postgres schema comparison.
|
Список | 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 по дате отправления: