cache lookup failed

From: Fabrice Pollet <pollet(at)ensta(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: cache lookup failed
Date: 2000-10-13 07:17:36
Message-ID: 200010130717.JAA32701@fab.ensta.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charles Tassell 2000-10-13 07:40:11 Function as Phantom Field
Previous Message Bruce Momjian 2000-10-13 03:02:05 FreeBSD core team history