Re: ERROR: DefineIndex: index function must be marked

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Elielson Fontanezi <ElielsonF(at)prodam(dot)sp(dot)gov(dot)br>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: ERROR: DefineIndex: index function must be marked
Date: 2003-07-25 19:47:24
Message-ID: 20030725124326.K38567-100000@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql


On Fri, 25 Jul 2003, Elielson Fontanezi wrote:

> Who can help me on that?
>
> First of all, my envoronment is:
> Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001
> i686 unknown
> pg_ctl (PostgreSQL) 7.2.

You should definately move to the highest 7.2 release (7.2.4 I think)
which shouldn't require a restore (although you should back up first in
any case). I think there were some reasonably important fixes between
7.2.1 and 7.2.4.

> CREATE OR REPLACE FUNCTION func_cod_secretaria(INTEGER) RETURNS INTEGER AS '
> DECLARE
> v_nr_proponente ALIAS FOR $1;
> BEGIN
> return TRUNC(v_nr_proponente/100000,0)*100000
> END;
> ' LANGUAGE 'plpgsql'
Add WITH (iscachable) after LANGUAGE 'plpgsql' to make the function usable
in the functional index unless I'm misremembering the old syntax.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-07-25 20:02:07 Using YY-MM-DD date input
Previous Message Elielson Fontanezi 2003-07-25 19:43:34 ERROR: DefineIndex: index function must be marked iscachable

Browse pgsql-sql by date

  From Date Subject
Next Message Eric Clark 2003-07-25 19:57:12 Re: locks and variable substitution
Previous Message Elielson Fontanezi 2003-07-25 19:43:34 ERROR: DefineIndex: index function must be marked iscachable