Re: Table checksum proposal - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: Table checksum proposal
Date
Msg-id 20140724202805.GD3996@hermes.hilbert.loc
Whole thread Raw
In response to Re: Table checksum proposal  (matt@byrney.com)
List pgsql-general
On Thu, Jul 24, 2014 at 03:06:28PM +0100, matt@byrney.com wrote:

> > select md5(string_agg(md5(c::text), '' order by md5(c::text))) from
> > pg_class c;
> >
> > (of course you can do it on any table, not only pg_class).
> >
> > If you want to use the xor idea (which make sense), all you need is to
> > write xor aggregate.
>
> This is nice and neat but there are some major disadvantages with this
> approach:
>
> 1. It can't detect differences in types, e.g. converting an INT column to
> TEXT will leave the checksum unchanged.

Unless you apply it to pg_attribute, no ?

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Table checksum proposal
Next
From: Mike Christensen
Date:
Subject: Regular expression question with Postgres