X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B7853D1C4B7; Fri, 25 Jul 2003 19:47:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 68816-04; Fri, 25 Jul 2003 16:46:37 -0300 (ADT) Received: from megazone.bigpanda.com (unknown [66.180.233.26]) by svr1.postgresql.org (Postfix) with ESMTP id 0F9D3D1C4C8; Fri, 25 Jul 2003 16:47:23 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 6BD0ED641; Fri, 25 Jul 2003 12:47:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 617885C0E; Fri, 25 Jul 2003 12:47:24 -0700 (PDT) Date: Fri, 25 Jul 2003 12:47:24 -0700 (PDT) From: Stephan Szabo To: Elielson Fontanezi Cc: pgsql-general , pgsql-sql Subject: Re: ERROR: DefineIndex: index function must be marked In-Reply-To: Message-ID: <20030725124326.K38567-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/1252 X-Sequence-Number: 46105 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.