Re: contrib/pgcrypto functions not IMMUTABLE?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: contrib/pgcrypto functions not IMMUTABLE?
Дата
Msg-id 20050703064332.GA34783@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: contrib/pgcrypto functions not IMMUTABLE?  (Russell Smith <mr-russ@pws.com.au>)
Ответы Re: contrib/pgcrypto functions not IMMUTABLE?  (Marko Kreen <marko@l-t.ee>)
Список pgsql-hackers
On Sun, Jul 03, 2005 at 04:24:31PM +1000, Russell Smith wrote:
> On Sun, 3 Jul 2005 03:32 pm, Michael Fuhr wrote:
> > I've noticed that contrib/pgcrypto/pgcrypto.sql.in doesn't include
> > a volatility category in its CREATE FUNCTION statements, so the
> > functions are all created VOLATILE.  Shouldn't most of them be
> > IMMUTABLE?  Or do the algorithms have side effects?
>
> I know the salt functions MUST stay volatile, as they produce different output
> every time you call them.  I've not looked at the pgcrypto code, so I can't
> make further comment than that.

Yeah, I see that gen_salt() needs to be volatile, but I was thinking
about functions like digest(), encrypt(), decrypt(), etc., that
would be expected to return the same output given the same input.
For example, the core md5() function is immutable, but pgcrypto's
digest() is volatile.  I was wondering if that's intentional or
just an oversight.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: Russell Smith
Дата:
Сообщение: Re: contrib/pgcrypto functions not IMMUTABLE?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Checkpoint cost, looks like it is WAL/CRC