Thread: need solution for cachelookupfailed error

need solution for cachelookupfailed error

From
Kiran Patel
Date:
Hello,

I have installed PosgreSQL 7 on Red Hat Linux 6.1. I am developing a CRM system using front hand "Enhydra" and back
handas "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
tableand 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
followingsyntax 

   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
solutionfor the above. 

Thank You
Kiran Patel

RE: need solution for cachelookupfailed error

From
"Darren King"
Date:
> 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