Re: tsearch comments

From: "Bjorn Metzdorf" <bm(at)turtle-entertainment(dot)de>
To: "Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: tsearch comments
Date: 2003-01-23 10:42:18
Message-ID: 00d801c2c2cc$1a02e730$81c206d4@office.turtleentertainment.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2003-01-23 11:08:05 Re: tsearch comments
Previous Message Chantal Ackermann 2003-01-23 09:16:01 Re: optimizing query