immutable functions and enumerate type casts in indexes

Поиск
Список
Период
Сортировка
От Edoardo Panfili
Тема immutable functions and enumerate type casts in indexes
Дата
Msg-id 48BC174F.3050506@aspix.it
обсуждение исходный текст
Ответы Re: immutable functions and enumerate type casts in indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

I have a problem with enumerated types in functions parameters.

my enumerated type is (this is a subset)
CREATE TYPE hibridation AS ENUM('none','genus','specie');

function declaration
CREATE FUNCTION ename(text,boolean,text,text RETURNS text AS
'funzioniGDB.so' LANGUAGE C IMMUTABLE;

index creation (the type of ibrido is hibridation)
CREATE INDEX i_specie_nome_specie ON specie
(esterna_nome(ibrido::text,proParte,genere,specie));

the result is
ERROR:  functions in index expression must be marked IMMUTABLE

Searching on google I found some explanation: the problem arises with
"non immutable" typea as "data" but I can't figure the problem (or
better, the solution) with enumerate types.

What can I do?

thank you
Edoardo







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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: refcursor
Следующее
От: Howard Cole
Дата:
Сообщение: Can I truncate statements in the log?