Michael Enke <[EMAIL PROTECTED]> writes:
> I need to know if multiple tables have (may have most probably)
> identical content.
That sounds me you should re-consider your database design. Having PK/FK
relations is the reason we divide common parts into separate tables to
avoid from data duplication.

> 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.

First alter related tables and prepend a hash field to each one. After
that, you can implement your own PL/pgSQL procedure which takes a table
name and queries supplied table's columns from information_schema and
builds an SQL query string to concatenate MD5 hash of available table
fields into a single field, and updates hash field of each field
according to computed hash.


Regards.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to