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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Calculating a hash / fingerprint for a row / tuple
Дата
Msg-id 3410.1144725714@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Calculating a hash / fingerprint for a row / tuple  (Randall Lucas <rlucas@tercent.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Date & Time with time zone
Следующее
От: "Wei Wei"
Дата:
Сообщение: Re: Date & Time with time zone