Re: tsearch comments - Mailing list pgsql-general

From Bjorn Metzdorf
Subject Re: tsearch comments
Date
Msg-id 00d801c2c2cc$1a02e730$81c206d4@office.turtleentertainment.de
Whole thread Raw
In response to Re: tsearch comments  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: tsearch comments
List pgsql-general
> Do index functions always have to be marked "iscachable" ?
>
> Btw, the error message was confusing. It said that the function has to be
> marked "isImmutable", but there is no such attribute, instead "iscachable"
> had to be used. This seems to be a bug.

The manual says:

"All functions and operators used in an index definition must be immutable,
that is, their results must depend only on their input arguments and never
on any outside influence (such as the contents of another table or the
current time). This restriction ensures that the behavior of the index is
well-defined. To use a user-defined function in an index, remember to mark
the function immutable when you create it."

Well, in the tsearch case the results don't depend on any influence outside
of the function. The stemmer is integrated in the function and we don't use
the current time nor another table. So it should be safe to mark that
function "iscachable" or when it is fixed "isimmutable", am I right?

Regards,
Bjoern


pgsql-general by date:

Previous
From: Chantal Ackermann
Date:
Subject: Re: optimizing query
Next
From: Oleg Bartunov
Date:
Subject: Re: tsearch comments