Re: Cache Lookup failed Error - while using Triggers - Mailing list pgsql-admin

From Joe Conway
Subject Re: Cache Lookup failed Error - while using Triggers
Date
Msg-id 3D8160BE.7050409@joeconway.com
Whole thread Raw
In response to Cache Lookup failed Error - while using Triggers  ("shreedhar" <shreedhar@lucidindia.net>)
List pgsql-admin
shreedhar wrote:
> Hi Joe,
>
> Thanks Alot,
>
> I followed how u said, then if I execute the same insert statement the
> following error is occuring.
>
> ERROR : Parse error at or near "empname"
>
> As I Check I didnot find any parse error there. This is error is occuring if
> and only if 'emp' table have trigger. Is there any problem in function
> 'aa_emp_stamp()'

I don't know what aa_emp_stamp() looks like. The function you sent in the
other day was called emp_stamp() -- is that the same? If so, you were missing
as ";":

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
          ^^^^
          missing a ;


Joe


pgsql-admin by date:

Previous
From: Naomi Walker
Date:
Subject: Re: Vaccuum/Analyze
Next
From: Tom Lane
Date:
Subject: Re: Vaccuum/Analyze