Re: [SQL] Cache lookup failed with FUNCTION + TRIGGER

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stéphane FILLON <fillons(at)offratel(dot)nc>
Cc: "pgsql sql" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Cache lookup failed with FUNCTION + TRIGGER
Date: 1999-08-04 22:07:14
Message-ID: 1236.933804434@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"=?iso-8859-1?Q?St=E9phane_FILLON?=" <fillons(at)offratel(dot)nc> writes:
> create function client() returns opaque as '
> begin
> if new.nocli ISNULL then
> raise exception "nocli null";
> end if;
> end;
> ' language 'plpgsql';

> create trigger client before insert on client
> for each row execute procedure client();

> When I try to insert a tuple in client I have the following error:

> "ERROR: fmgr_info: function 149857: cache lookup failed"

I'm guessing you dropped and recreated the function without dropping
and recreating the trigger. It looks like triggers link to functions
on the basis of OID, not name, so after you recreate the function (with
a new OID), the old trigger no longer has a procedure to execute...

regards, tom lane

Browse pgsql-sql by date

  From Date Subject
Next Message Kevin Sangalee 1999-08-04 22:08:43 Why is this sub-query select so slow?
Previous Message astromonk 1999-08-04 18:22:42 sequences not reliable?