| От | Mª José Sempere |
|---|---|
| Тема | digest as IMMUTABLE function |
| Дата | |
| Msg-id | 000001c4deb4$7fa9f1e0$0900a8c0@mj обсуждение исходный текст |
| Список | pgsql-admin |
Hello, We were trying to create an index using the digest function like that (where picture is a bytea field): create unique index my_index on my_table digest(picture, 'md5')); but we got the error: ERROR: functions in index expression must be marked IMMUTABLE So, we have created the function digestinmutable(), like that: CREATE OR REPLACE FUNCTION digestinmutable(bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_digest' LANGUAGE 'c' IMMUTABLE; And after that, we have created the index using the new function (digestinmutable) : create unique index my_index on my_table digestinmutable(picture, 'md5')); IT SEEMS TO WORK OK. Does Anybody know if we'll have any problem using md5 in that way? Thank you very much for your help. Bye
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера