Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA64578 for ; Wed, 4 Aug 1999 18:07:53 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id SAA01238; Wed, 4 Aug 1999 18:07:14 -0400 (EDT) To: "=?iso-8859-1?Q?St=E9phane_FILLON?=" cc: "pgsql sql" Subject: Re: [SQL] Cache lookup failed with FUNCTION + TRIGGER In-reply-to: Your message of Wed, 4 Aug 1999 14:21:57 +1100 <000201bede95$30933640$c40a8280@portable> Date: Wed, 04 Aug 1999 18:07:14 -0400 Message-ID: <1236.933804434@sss.pgh.pa.us> From: Tom Lane "=?iso-8859-1?Q?St=E9phane_FILLON?=" 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