Cache Lookup failed Error - while using Triggers

From: "shreedhar" <shreedhar(at)lucidindia(dot)net>
To: "Postgres" <pgsql-admin(at)postgresql(dot)org>
Subject: Cache Lookup failed Error - while using Triggers
Date: 2002-09-11 04:44:41
Message-ID: 003101c2594d$f1b24060$1201a8c0@a4005
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All,

I took the following example to create trigger

TABLE

CREATE TABLE emp (
empname text,
salary integer,
last_date timestamp,
last_user text);

Function emp_stamp() returns OPAQUE

DECLARE
current_user text;
BEGIN
-- Check that empname and salary are given
IF NEW.empname ISNULL THEN
RAISE EXCEPTION ''empname cannot be NULL value'';
END IF;
IF NEW.salary ISNULL THEN
RAISE EXCEPTION ''% cannot have NULL salary'', NEW.empname;
ELSE
current_user := NEW.empname;
END IF
-- Who works for us when she must pay for?
IF NEW.salary < 0 THEN
RAISE EXCEPTION ''% cannot have a negative salary'',
NEW.empname;
END IF;
-- Remember who changed the payroll when
NEW.last_date := ''now'';
NEW.last_user := NEW.empname;
RETURN NEW;
END;

Trigger

CREATE TRIGGER emp_stamp BEFORE INSERT OR UPDATE ON emp
FOR EACH ROW EXECUTE PROCEDURE emp_stamp();

If I use the following INSERT Statement

INSERT INTO emp (empname,salary, last_date, last_user) VALUES ('sree',1000,
'2002-09-11','sreedhar');

I am getting the following Error

'ERROR : fmgr_info : function 1059155 : cahce lookup failed
PostgreSQL status : PGRES_FATAL_ERROR'

Can any body tell that what is this error. How can I solve this.

With Best Regards,
Sreedhar Bhaskararaju 1,2nd Main Road, KottuGardens, Chennai - 600 085 Ph :
4475111 Email : shreedhar(at)lucidindia(dot)net

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Joe Conway 2002-09-11 05:08:11 Re: Cache Lookup failed Error - while using Triggers
Previous Message Bruce Momjian 2002-09-10 23:03:06 Re: fsync or fdatasync