Re: trigger error - Mailing list pgsql-sql

From Dmitry Tkach
Subject Re: trigger error
Date
Msg-id 3EE5FFEB.8090608@openratings.com
Whole thread Raw
In response to trigger error  ("Yudie" <yudie@axiontech.com>)
List pgsql-sql
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





pgsql-sql by date:

Previous
From: "Yudie"
Date:
Subject: trigger error
Next
From: "Mendola Gaetano"
Date:
Subject: Re: trigger error