Re: md5 function

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: md5 function
Дата
Msg-id 87fzfjjxw4.fsf@asmodeus.mcnaught.org
обсуждение исходный текст
Ответ на Re: md5 function  (Jon Earle <je_pgsql@kronos.honk.org>)
Список pgsql-general
Jon Earle <je_pgsql@kronos.honk.org> writes:

> Is there a way to, when I add a record to a table, have the md5 hash
> computed and stored in the same table and then returned to the calling
> program?  Currently, I'm using the perl md5 function to compute the hash
> and store it in the DB but I'm thinking that offloading this to the DB
> itself might be faster (of course, if that's not true and the way I'm
> doing things now is fine, then I'll leave it as it is).

If your webserver is heavily loaded and the DB server isn't too busy,
this might be a win; otherwise it's unlikely to make any difference.
I think perl calls out to C to do the md5 computation, so it's just as
fast as the version in Postgres.

That said, the way to do it if you wanted to would be to write an
insert_my_record() function that stores the data for the record and
returns the md5 hash.

-Doug

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

Предыдущее
От: Paul Thomas
Дата:
Сообщение: Re: partial upgradation from 7.1.3 to 7.4
Следующее
От: "Bob Powell"
Дата:
Сообщение: Excel, OpenOffice and Postgres