Re: md5 hash on table row

Поиск
Список
Период
Сортировка
Искать
От
Michael Fuhr
Тема
Re: md5 hash on table row
Дата
Msg-id
20051102163533.GA11978@winnie.fuhr.org
Ответ на
Список
Дерево обсуждения
md5 hash on table row Jon Lapham <lapham@jandr.org>
Re: md5 hash on table row Michael Fuhr <mike@fuhr.org>
Re: md5 hash on table row Michael Fuhr <mike@fuhr.org>
Re: md5 hash on table row Tom Lane <tgl@sss.pgh.pa.us>
Re: md5 hash on table row Michael Fuhr <mike@fuhr.org>
Re: md5 hash on table row "A. Kretschmer" <andreas.kretschmer@schollglas.com>
Re: md5 hash on table row Michael Fuhr <mike@fuhr.org>
Re: md5 hash on table row Bruce Momjian <pgman@candle.pha.pa.us>
Re: md5 hash on table row Tom Lane <tgl@sss.pgh.pa.us>
Re: md5 hash on table row Jon Lapham <lapham@jandr.org>
Re: md5 hash on table row Michael Fuhr <mike@fuhr.org>
On Wed, Nov 02, 2005 at 11:38:46AM -0200, Jon Lapham wrote:
> I would love something like this:
> select id, md5(*) from mytable;

Is it acceptable to have some decoration around the data being
hashed?  If so then this example might be useful:

test=> SELECT * FROM foo;
 id | integer |      text      |    date    | boolean |    bytea     
----+---------+----------------+------------+---------+--------------
  1 |     123 | this is a test | 2005-11-02 | t       | \000\001\002
(1 row)

test=> SELECT id, foo FROM foo;
 id |                           foo                           
----+---------------------------------------------------------
  1 | (1,123,"this is a test",2005-11-02,t,"\\000\\001\\002")
(1 row)

test=> SELECT id, md5(textin(record_out(foo))) FROM foo;
 id |               md5                
----+----------------------------------
  1 | b1cbe3d5ed304f31da57b85258f20c8f
(1 row)

-- 
Michael Fuhr
В списке pgsql-general по дате отправления
От: Apu Islam
Дата:
Сообщение: Re: Postgres + CentOS
От: Harald Fuchs
Дата:
Сообщение: Re: Disappearing Records
FAQ