pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: shreedhar <shreedhar@lucidindia.net>
To: Postgres <pgsql-admin@postgresql.org>
Subject: Cache Lookup failed Error - while using Triggers
Date: Wed, 11 Sep 2002 10:14:41 +0530
Message-ID: <003101c2594d$f1b24060$1201a8c0@a4005> (raw)

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@lucidindia.net




view thread (4+ messages)  latest in thread

Message-ID: <003101c2594d$f1b24060$1201a8c0@a4005>
Permalink:  ../003101c2594d$f1b24060$1201a8c0@a4005/
Also on:    postgresql.org/message-id/003101c2594d$f1b24060$1201a8c0@a4005

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: shreedhar@lucidindia.net
  Subject: Re: Cache Lookup failed Error - while using Triggers
  In-Reply-To: <003101c2594d$f1b24060$1201a8c0@a4005>
  References: <003101c2594d$f1b24060$1201a8c0@a4005>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox