Thread

  1. need solution for cachelookupfailed error

    Kiran Patel <k.patel@i-engineering.com> — 2001-03-22T11:09:42Z

    Hello,
    
    I have installed PosgreSQL 7 on Red Hat Linux 6.1. I am developing a CRM system using front hand "Enhydra" and back hand as "PostgreSql". I have encountered the problem in
    developing a function. The error message I receive is fmgr_info: function 18816: cache lookup failed. The structure of table and proceedure I use is as follows.
    
    Company Table Structure
    
    create table company ( id serial PRIMARY KEY, comp_name varchar(100), shortname varchar(20));
    
    Insert Function for company table
    
    create function insertcompany(varchar(100),varchar(20)) returns int4 as
    'begin
         Insert into company (comp_name,shortname) values ($1,$2);
         return 0;
    end;' language 'plpgsql';
    
    Now If I run the above function from the psql command prompt with the following syntax
       select insertcompany('iengineering.com','eslab');
    
    Then It gives me the error message fmgr_info: function 18816: cache lookup failed.
    
    If I Insert the values into the company table from the psql command prompt without using the function with the following syntax
    
       Insert into company ( comp_name,shortname) values ('iengineering.com','eslab');
    
    Then It inserts the value with out any error and I receive the message INSERT 97424 1 on the command prompt.
    
    One row value get's inserted. But I can not insert values using the function call.
    
    If you have any solution for the error message fmgr_info: function 18816: cache lookup failed. Then suggest me the solution for the above.
    
    Thank You
    Kiran Patel
    
  2. RE: need solution for cachelookupfailed error

    Darren King <darrenk@insightdist.com> — 2001-03-22T17:18:31Z

    > Company Table Structure
    > create table company ( id serial PRIMARY KEY, comp_name varchar(100),
    shortname varchar(20));
    > Insert Function for company table
    > create function insertcompany(varchar(100),varchar(20)) returns int4
    as
    > 'begin
    >     Insert into company (comp_name,shortname) values ($1,$2);
    >     return 0;
    > end;' language 'plpgsql';
    > Now If I run the above function from the psql command prompt with the
    following syntax
    >    select insertcompany('iengineering.com','eslab');
    
    Have you tried explicitly casting the strings to varchar in the call to
    insertcompany in the above select statement?
    
    If the parser is treating them as something other than varchar, the
    system would look for an insertcompany function those types for args.
    
    darrenk