Re: md5 of table

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: md5 of table
Date: 2011-09-01 09:48:16
Message-ID: 201109011248.16751.achill@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

md5 has size limitations, the second approach seems more practical.

Στις Thursday 01 September 2011 12:30:45 ο/η Karsten Hilbert έγραψε:
> On Thu, Sep 01, 2011 at 11:47:24AM +0300, Sim Zacks wrote:
>
> > Is there a way to get an md5 or other hash of an entire table?
> >
> > I want to be able to easily compare 2 tables in different databases.
> >
> > I thought about using dblink and the EXCEPT query, but then I need to
> > know the field list of each query result, which is a pain in the
> > butt.
> >
> > If I could return an md5 of the entire table, then I could check if
> > the tables have the same hash and be confident enough that the tables
> > were identical.
>
> One option might be to pg_dump in an appropriate format and
> md5-compare the output ?
>
> Another option might be to
>
> - cross-check columns/column types
> - query from information_schema
> - compare row counts
> - may need a lock
> - compare table sizes
> - may need vaccum ?
>
> If all three match that may be good enough ?
>
> Karsten
> --
> GPG key ID E4071346 @ gpg-keyserver.de
> E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
>

--
Achilleas Mantzios

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2011-09-01 10:14:11 Re: md5 of table
Previous Message Karsten Hilbert 2011-09-01 09:30:45 Re: md5 of table