Search Postgresql Archives

Re: Calculating a hash / fingerprint for a row / tuple

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Randall Lucas <rlucas@xxxxxxxxxxx> writes:
> I'm looking for a way to calculate a hashcode or fingerprint for a row /
> tuple of arbitrary width.  The goal is to be able to store, in an audit
> table, a fingerprint which could be compared against a later fingerprint
> to detect changes (this application does not call for cryptographic
> level security, so a simple checksum would be adequate for now). 
> Something like:

> SELECT id, row_hashcode(*) FROM my_table;

> id   |   row_hashcode
>  1    a3843587d893589ef321d31
>  2    934983497f9083298cb0843

Try "select md5(textin(record_out(mytbl.*))) from mytbl;" ... a bit
klugy, but it works.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux