Re: Is there an md5sum for tables?

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there an md5sum for tables?
Date: 2008-04-02 15:26:13
Message-ID: BF09A86C-0EE7-46B9-9EE2-81BC924D0D61@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 1, 2008, at 8:56 PM, Michael Enke wrote:

> Hi all,
> 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?
> If not, does it make no sense to use such an approach?

I've found that it's pretty easy to dump both tables to text files and
then diff them. Then, not only do you see if there are differences,
ou can see what's different about them, which is probably going to be
your next question when you see they're not the same. :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-02 15:33:35 Re: Foreign keys causing conflicts leading toserialization failures
Previous Message Kev 2008-04-02 15:03:43 drop database regardless of connections