X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7BF3BD1C4CC for ; Fri, 25 Jul 2003 19:22:36 +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 65557-04 for ; Fri, 25 Jul 2003 16:21:49 -0300 (ADT) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by svr1.postgresql.org (Postfix) with ESMTP id 745D5D1C4BC for ; Fri, 25 Jul 2003 16:22:34 -0300 (ADT) Received: from klaster.net (core-1.citynet.pl [80.48.135.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 1B0112B3CF; Fri, 25 Jul 2003 21:22:26 +0200 (CEST) Message-ID: <3F218374.9000204@klaster.net> Date: Fri, 25 Jul 2003 21:22:28 +0200 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Elielson Fontanezi Cc: pgsql-sql Subject: Re: ERROR: DefineIndex: index function must be marked iscachable References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/383 X-Sequence-Number: 14497 Dnia 2003-07-25 21:09, Użytkownik Elielson Fontanezi napisał: > Hi all! > > What can I do in this case? > I could not found anything about iscachable. > > postgres$ cat in.sql > create index bt_proposta_f01 on proposta > using btree (func_cod_secretaria(nr_proponente)); > > postgres$ psql -d escola -f in.sql > psql:in.sql:2: ERROR: DefineIndex: index function must be marked iscachable > postgres$ You should follow the error. Your function func_cod_secretaria has to be declared as cacheable. (Look into documentation - sql commands / create function). IMMUTABLE function should help. This function has also for some nr_proponente returns always the same value (look at IMMUTABLE description) Regards, Tomasz Myrta