Re: md5 of table

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: md5 of table
Date: 2011-09-01 10:14:11
Message-ID: 4E5F5AF3.5060708@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/01/2011 12:26 PM, Pavel Stehule wrote:
> Hello
>
> postgres=# create table tt(a int, b varchar);
> CREATE TABLE
> postgres=# insert into tt values(10,'hello');
> INSERT 0 1
>
> postgres=# select md5(array_to_string(array_agg(md5(tt::text)),'')) from tt;
> md5
> ----------------------------------
> 20a92a676f52699e613da1bb114bd6f0
> (1 row)
>
> Regards
>
> Pavel Stehule
Would be perfect, but 8.2 can't cast a UDT to text.
ERROR: cannot cast type tt to text
LINE 1: select tt::text from tt

Thanks
Sim

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rik Bellens 2011-09-01 10:32:19 strange table disk sizes
Previous Message Achilleas Mantzios 2011-09-01 09:48:16 Re: md5 of table