Thread: cache lookup failed

cache lookup failed

From
Fabrice Pollet
Date:
After create function and trigger, when I update "fams" by delete entry in
table "indi" I get this message :

ERROR:  fmgr_info: function 19968: cache lookup failed

Here is an SQL script that makes this happen:
------------------------------------------------------------------------------
create table indi(
id serial primary key,
first_name varchar(40),
last_name varchar(40),
surname varchar(40),
sex char check (sex='M' or sex='F' or sex=''),
refn varchar(40) unique
check (first_name notnull or last_name notnull or surname notnull);

create table fams (
id serial primary key,
husb int check (sex(husb)='M' or sex(husb)=''),
wife int check (sex(wife)='F' or sex(wife)=''),
refn varchar(40) unique,
foreign key (husb) references indi on delete set null on update cascade,
foreign key (wife) references indi on delete set null on update cascade,
check (husb <> wife));

create function sex(int) returns char as 'select sex from indi where id = $1;'
language 'sql';

create function func_fams()
returns opaque
as '
delete from fams where (husb isnull and wife isnull);'
language 'plpgsql';

create trigger trig_fams after update on fams for each row execute procedure
func_fams();

pollet-lorand=>  select * from indi;
 id |         first_name         | last_name | surname | sex | refn
----+----------------------------+-----------+---------+-----+------
  4 | Jacqueline Anna Marie-Ange | LORAND    |         |     |
  1 | Fabrice                    | POLLET    |         | M   |
  3 | Véronique                  | LEROY     |         | F   |
  9 | Maurice Joseph             | POLLET    |         |     |
(4 rows)

pollet-lorand=> select * from fams;
 id | husb | wife | refn
----+------+------+------
  1 |    1 |    3 |
  4 |    9 |      |
(2 rows)

pollet-lorand=> delete from indi where id=9;
ERROR:  fmgr_info: function 19968: cache lookup failed

--
   Fabrice POLLET

  ENSTA / LEI / AMI
 32 boulevard Victor    Tél    : +33 01 45 52 54 25
75739 PARIS CEDEX 15    Fax    : +33 01 45 52 55 87
    F R A N C E


Re: cache lookup failed

From
Henk van Lingen
Date:
On Fri, Oct 13, 2000 at 09:17:36AM +0200, Fabrice Pollet wrote:
  : After create function and trigger, when I update "fams" by delete entry in
  : table "indi" I get this message :
  :
  : ERROR:  fmgr_info: function 19968: cache lookup failed

  Hi,

  I recently struggled with the same error message and found out
  that it occured when you define a trigger which uses a function,
  drop the function and redefine it. The trigger in that case still
  points to some undefined space...

  I'm not sure whether I call this a bug or whether this is normal
  behaviour in RDBMS's. I would expect these pointers to be based on
  names but maybe thats not possible ?

  Regards

--
+-----------------------------------------------------------------------+
| Henk van Lingen, Systems Administrator,             <henkvl@cs.uu.nl> |
| Dept. of Computer Science, Utrecht University.  phone: +31-30-2535278 |
+--------------------- http://henk.vanlingen.net/ ----------------------+