Re: db schema diff

Поиск
Список
Период
Сортировка
От
Тема Re: db schema diff
Дата
Msg-id 64719.216.238.112.88.1081798687.squirrel@$HOSTNAME
обсуждение исходный текст
Ответ на db schema diff  (Igor Shevchenko <igor@carcass.ath.cx>)
Ответы Re: db schema diff  (Igor Shevchenko <igor@carcass.ath.cx>)
Список pgsql-general
> Suppose I have "pg_dump -s" of two pg installs, one is "dev", another
> is  "production". Their schemas don't differ too much, and I want to
> get a "diff  -u"-like schema diff so I can quickly add missing/remove
> old
> tables/sequences/etc to one or another (manually). Is there some quick
> tool  for doing this ?
>
> There was a thread about it sometime in aug, 2002, but it ended without
>  producing anything useful.

This is the closest I get, but it is only marginally useful:

--File: pg_compare --------------------------------------
#!/bin/bash
# Script to dump a PostgreSQL database schema for two databases
# and compare them.
# Author: Berend M. Tober <btober@computer dot org>
# Date:   August 25, 2003

PG_DUMP=/usr/bin/pg_dump
DIFF=/usr/bin/diff
GREP=/bin/grep
CAT=/bin/cat

-- 5434 is the port on which DEV runs
-- 5433 is the port on which QAT runs

${PG_DUMP} -s -p 5432 mydb|${GREP} -v '^--'|${CAT} -s >5432.sql
${PG_DUMP} -s -p 5433 mydb|${GREP} -v '^--'|${CAT} -s >5433.sql
${PG_DUMP} -s -p 5434 mydb|${GREP} -v '^--'|${CAT} -s >5434.sql

${DIFF} 5432.sql 5433.sql > 5432-5433.diff
${DIFF} 5433.sql 5434.sql > 5433-5434.diff


~Berend Tober




В списке pgsql-general по дате отправления:

Предыдущее
От: Clodoaldo Pinto Neto
Дата:
Сообщение: Re: COPY TO order
Следующее
От: Igor Shevchenko
Дата:
Сообщение: Re: db schema diff