Randall Lucas <rlucas@tercent.com> 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