Re: Is there an md5sum for tables?

Поиск
Список
Период
Сортировка
От btober@ct.metrocast.net
Тема Re: Is there an md5sum for tables?
Дата
Msg-id 47F37985.7010008@ct.metrocast.net
обсуждение исходный текст
Ответ на Is there an md5sum for tables?  (Michael Enke <michael.enke@wincor-nixdorf.com>)
Список pgsql-general
Michael Enke wrote:
> I need to know if multiple tables have (may have most probably)
> identical content.
> Since I want a fast solution (which means not comparing tables row by row),
> I thought it would be a good idea to have an sql function operating on a
> table or view
> similar to md5sum on a file and only compare the generated hashes.
> I did not find such a function in the documentation.
>
> Is such a function already available?

I think what I would do is develop a shell script that ran select
queries (with an "order by" clause, of course) against the tables, then
compare the output the result sets using diff.

If you need to monitor for differences over time, like to catch changes,
then drive that script with cron and have it generate an email warning
message when diff notices that the output are no longer identical.

-- BMT



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

Предыдущее
От: Peter Schuller
Дата:
Сообщение: Re: Foreign keys causing conflicts leading to serialization failures
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Foreign keys causing conflicts leading toserialization failures