X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id D8CDE30DCE2 for ; Tue, 10 Jun 2003 15:56:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 05191-03 for ; Tue, 10 Jun 2003 12:56:05 -0300 (ADT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id 0281030DE4C for ; Tue, 10 Jun 2003 12:56:05 -0300 (ADT) Received: from openratings.com (cancun.hq.openratings.com [10.0.0.225]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id M1TGVTP6; Tue, 10 Jun 2003 11:56:04 -0400 Message-ID: <3EE5FFEB.8090608@openratings.com> Date: Tue, 10 Jun 2003 11:57:31 -0400 From: Dmitry Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yudie Cc: pgsql-sql@postgresql.org Subject: Re: trigger error References: <001b01c32f69$eda57120$8401a8c0@yudie> In-Reply-To: <001b01c32f69$eda57120$8401a8c0@yudie> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/84 X-Sequence-Number: 13842 You must have dropped and recreated the function after your trigger was created... You need to recreate the trigger now, so that it picks up the new function id. In the future use 'CREATE OR REPLACE' to modify a function instead of DROP and CREATE - this will make sure the modified function keeps its id. I hope, it helps... Dima Yudie wrote: > Hi, > I',m trying to create trigger with plpgsql trigger function > then I got this error message when trigger executed: > > Number: -2147467259 > Error while executing th query; > ERROR: fmgr_info: function 1546856080: cache lookup failed > > Here is the function code: > > CREATE FUNCTION TRIGGER_UPDATE_AXPRDT_STATUS() > RETURNS OPAQUE > AS 'BEGIN > IF NEW.ONHAND = 0 THEN > NEW.STATUS = ''D''; > END IF; > RETURN NEW; > END;' > LANGUAGE 'plpgsql'; > > CREATE TRIGGER TRIGGER_AXPRDT_FUTURESTATUS > BEFORE UPDATE ON AXPRDT > FOR EACH ROW > EXECUTE PROCEDURE TRIGGER_UPDATE_AXPRDT_STATUS(); > > > Please Help.. > > Yudie